This commit is contained in:
suyl
2021-09-01 17:34:31 +08:00
parent 1e9f0660b0
commit fd90df749a

View File

@@ -791,7 +791,7 @@ func OrderNotifyReport(ctx *jxcontext.Context, storeIDs, brandIDs []int, vendorI
results []*OrderNotifyReportResult
)
sql := `
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
SELECT SQL_CALC_FOUND_ROWS 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