aa
This commit is contained in:
@@ -778,6 +778,11 @@ func UserMemberReport(ctx *jxcontext.Context, vendorID int, keyword string, offs
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OrderNotifyReportResult struct {
|
type OrderNotifyReportResult struct {
|
||||||
|
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Count int `json:"count"` //总通知数
|
||||||
|
SmsCount int `json:"smsCount"` //短信通知数
|
||||||
|
VoiceCount int `json:"voiceCount"` //语音通知数
|
||||||
}
|
}
|
||||||
|
|
||||||
func OrderNotifyReport(ctx *jxcontext.Context, storeIDs, brandIDs []int, vendorID, notifyType int, keyword string, isFinished bool, fromTime, toTime string, offset, pageSize int) (page *model.PagedInfo, err error) {
|
func OrderNotifyReport(ctx *jxcontext.Context, storeIDs, brandIDs []int, vendorID, notifyType int, keyword string, isFinished bool, fromTime, toTime string, offset, pageSize int) (page *model.PagedInfo, err error) {
|
||||||
@@ -786,7 +791,7 @@ func OrderNotifyReport(ctx *jxcontext.Context, storeIDs, brandIDs []int, vendorI
|
|||||||
results []*OrderNotifyReportResult
|
results []*OrderNotifyReportResult
|
||||||
)
|
)
|
||||||
sql := `
|
sql := `
|
||||||
SELECT *
|
SELECT IF(a.store_id = 0, a.jx_store_id, a.store_id) store_id, b.name ,COUNT(*) count, COUNT(a.notify_type = 1 or NULL) sms_count, COUNT(a.notify_type = 2 or NULL) voice_count
|
||||||
FROM goods_order a
|
FROM goods_order a
|
||||||
LEFT JOIN store b ON IF(a.store_id = 0 ,a.jx_store_id, a.store_id) = b.id
|
LEFT JOIN store b ON IF(a.store_id = 0 ,a.jx_store_id, a.store_id) = b.id
|
||||||
LEFT JOIN user c ON c.mobile = b.market_man_phone
|
LEFT JOIN user c ON c.mobile = b.market_man_phone
|
||||||
@@ -839,8 +844,6 @@ func OrderNotifyReport(ctx *jxcontext.Context, storeIDs, brandIDs []int, vendorI
|
|||||||
sqlParams = append(sqlParams, pageSize, offset)
|
sqlParams = append(sqlParams, pageSize, offset)
|
||||||
txDB, _ := dao.Begin(db)
|
txDB, _ := dao.Begin(db)
|
||||||
defer dao.Commit(db, txDB)
|
defer dao.Commit(db, txDB)
|
||||||
fmt.Println(sql)
|
|
||||||
fmt.Println(sqlParams)
|
|
||||||
if err = dao.GetRowsTx(txDB, &results, sql, sqlParams...); err == nil {
|
if err = dao.GetRowsTx(txDB, &results, sql, sqlParams...); err == nil {
|
||||||
page = &model.PagedInfo{
|
page = &model.PagedInfo{
|
||||||
TotalCount: dao.GetLastTotalRowCount2(db, txDB),
|
TotalCount: dao.GetLastTotalRowCount2(db, txDB),
|
||||||
|
|||||||
Reference in New Issue
Block a user