From a43e5f1090146ba17c961129b8a8fcbccc35c51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Sun, 29 Sep 2024 10:10:39 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/store.go | 32 ++++++++++++++++++++++++++------ business/model/dao/act.go | 1 + controllers/cms_store.go | 3 ++- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 3a256b521..2219c0a58 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -111,8 +111,10 @@ type StoresInfo struct { type JxBadCommentsExt struct { legacymodel.JxBadComments - StoreName string `json:"storeName"` - CityName string `json:"cityName"` + StoreName string `json:"storeName"` + CityName string `json:"cityName"` + OperatorPhone string `json:"operatorPhone"` + UserName string `json:"userName"` VendorOrderID2 string `orm:"column(vendor_order_id2);size(48);index" json:"vendorOrderID2"` } @@ -2031,7 +2033,7 @@ func TmpGetJxBadCommentsNo(ctx *jxcontext.Context, storeID int) (count int, err return count, err } -func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeIDs []int, offset, pageSize, commentType int, fromTime, toTime time.Time) (retVal map[string]interface{}, err error) { +func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeIDs []int, offset, pageSize, commentType int, fromTime, toTime time.Time, orderFlag, operatorPhone string) (retVal map[string]interface{}, err error) { db := dao.GetDB() //权限 if permission.IsRoled(ctx) { @@ -2058,11 +2060,19 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeI sql := ` SELECT SQL_CALC_FOUND_ROWS t1.*, t2.name store_name, t3.name city_name, - t4.vendor_order_id2 + t4.vendor_order_id2, + CASE t1.order_flag + WHEN 0 THEN t2.operator_phone + WHEN 1 THEN t2.operator_phone2 + WHEN 2 THEN t2.operator_phone3 + ELSE t2.market_man_phone + END as operator_phone, + t5.name as user_name, FROM jx_bad_comments t1 LEFT JOIN store t2 ON t2.id = t1.jxstoreid LEFT JOIN place t3 ON t3.code = t2.city_code LEFT JOIN goods_order t4 ON t4.vendor_order_id = t1.order_id AND t4.vendor_id = t1.order_flag + INNER JOIN user t5 ON t5.mobile = operator_phone WHERE 1 = 1 ` sqlParams := []interface{}{} @@ -2070,8 +2080,8 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeI keywordLike := "%" + keyword + "%" sql += ` AND (t1.order_id LIKE ? OR t1.jxstoreid LIKE ? OR t1.userphone LIKE ? OR t1.scorecontent LIKE ? OR t1.vendertags LIKE ? OR t1.updated_scorecontent LIKE ? - OR t1.updated_vendertags LIKE ? OR t2.name LIKE ?)` - sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike) + OR t1.updated_vendertags LIKE ? OR t2.name LIKE ? OR t1.vendor_order_id LIKE ?)` + sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike) } if len(storeIDs) > 0 { sql += " AND t1.jxstoreid IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")" @@ -2094,6 +2104,16 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeI sql += " AND t1.createtime < ?" sqlParams = append(sqlParams, toTime) } + + if orderFlag != "" { + sql += " AND t1.order_flag = ?" + sqlParams = append(sqlParams, toTime) + } + if operatorPhone != "" { + sql += " AND (t2.market_man_hone = ? OR t2.operator_phone = ? OR t2.operator_phone1 = ? OR t2.operator_phone2 = ?)" + sqlParams = append(sqlParams, operatorPhone, operatorPhone, operatorPhone, operatorPhone) + } + sql += " ORDER BY t1.createtime DESC" pageSize = jxutils.FormalizePageSize(pageSize) offset = jxutils.FormalizePageOffset(offset) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index 55905243d..e70e6bd21 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -153,6 +153,7 @@ func GetActStoreSkuVendorList(db *DaoDB, actID int, vendorIDs, storeIDs, skuIDs totalCount = GetLastTotalRowCount2(db, txDB) } + // 统计门店活动商品一个月之内的销量 storeAndSkuMap := make(map[int][]int, 0) storeActMap := make(map[int][]*model.ActStoreSku2, 0) for _, v := range actStoreSkuList { diff --git a/controllers/cms_store.go b/controllers/cms_store.go index c519c6506..b2b6dc72f 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -310,9 +310,10 @@ func (c *StoreController) TmpGetJxBadCommentsByStoreId() { // @Param token header string true "认证token" // @Param type query int true "评论类型,0:差评,1:所有,2:已解决" // @Param keyword query string false "关键字" -// @Param storeIDs query string false "门店I列表" +// @Param storeIDs query string false "门店Id列表" // @Param fromTime query string false "创建起始时间" // @Param toTime query string false "创建结束时间" +// @Param orderFlag query string false "订单平台[0,1,2]" // @Param offset query int false "起始页,从1开始" // @Param pageSize query int false "页大小(-1表示无限大)" // @Success 200 {object} controllers.CallResult