From ff62d8c472287b529cf69239754bb068d1550cfb Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Sat, 22 May 2021 15:59:52 +0800 Subject: [PATCH] aa --- business/jxstore/report/report.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index daba9db85..5476522dd 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -709,9 +709,9 @@ func UserMemberReport(ctx *jxcontext.Context, vendorID int, keyword string, offs ) var list []*dao.UserMemberReportResult sql := ` - SELECT a.mobile, IF(a.vendor_id = ?, b.name, t1.consignee_name) name, IF(a.deleted_at = ?, ?, ?) status, a.vendor_id, t1.buy_count, t1.buy_price, - t1.good_comment_count, t1.bad_comment_count, t2.finished_count, t2.finished_price - FROM user_member a + SELECT SQL_CALC_FOUND_ROWS a.mobile, IF(a.vendor_id = ?, b.name, t1.consignee_name) name, IF(a.deleted_at = ?, ?, ?) status, a.vendor_id, t1.buy_count, t1.buy_price, + t1.good_comment_count, t1.bad_comment_count, t2.finished_count, t2.finished_price + FROM user_member a LEFT JOIN user b ON a.mobile = b.mobile LEFT JOIN ( SELECT a.mobile, MAX(b.consignee_name) consignee_name, COUNT(b.vendor_store_id) buy_count, SUM(ISNULL(b.actual_pay_price)) buy_price, COUNT(c.score > 3) good_comment_count, COUNT(c.score < 3) bad_comment_count @@ -726,6 +726,7 @@ func UserMemberReport(ctx *jxcontext.Context, vendorID int, keyword string, offs LEFT JOIN goods_order b ON a.mobile = b.consignee_mobile2 AND a.vendor_id = b.vendor_id AND b.order_type = ? AND status = ? AND b.store_id <> ? GROUP BY 1 )t2 ON t2.mobile = a.mobile + WHERE 1 = 1 ` sqlParams := []interface{}{ model.VendorIDJX, utils.DefaultTimeValue, model.YES, model.NO,