From e708776c29c48a7e3a3d044370f118269a13f0d3 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Fri, 27 Aug 2021 15:57:22 +0800 Subject: [PATCH] aa --- business/jxstore/report/report.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index a88e573d1..aa3981c98 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -778,6 +778,11 @@ func UserMemberReport(ctx *jxcontext.Context, vendorID int, keyword string, offs } 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) { @@ -786,7 +791,7 @@ func OrderNotifyReport(ctx *jxcontext.Context, storeIDs, brandIDs []int, vendorI results []*OrderNotifyReportResult ) 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 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 @@ -839,8 +844,6 @@ func OrderNotifyReport(ctx *jxcontext.Context, storeIDs, brandIDs []int, vendorI sqlParams = append(sqlParams, pageSize, offset) txDB, _ := dao.Begin(db) defer dao.Commit(db, txDB) - fmt.Println(sql) - fmt.Println(sqlParams) if err = dao.GetRowsTx(txDB, &results, sql, sqlParams...); err == nil { page = &model.PagedInfo{ TotalCount: dao.GetLastTotalRowCount2(db, txDB),