From 73d51012d68ad4d60b8b04a640f51e7032bb40e3 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 8 Jun 2021 14:01:33 +0800 Subject: [PATCH] aa --- business/jxstore/cms/store_sku.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 0e883af9c..be04e3a13 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -1099,6 +1099,7 @@ type GetStoresSkusSaleInfoNewResult struct { StoreID int `orm:"column(store_id)" json:"storeID"` StoreName string `json:"storeName"` SkuID int `orm:"column(sku_id)" json:"skuID"` + SkuNameID int `orm:"column(name_id)" json:"skuNameID"` SkuName string `json:"skuName"` SaleCount int `json:"saleCount"` //销量 } @@ -1116,7 +1117,7 @@ func GetStoresSkusSaleInfoNew(ctx *jxcontext.Context, vendorIDs, storeIDs, skuID } sql := ` SELECT SQL_CALC_FOUND_ROWS t1.* FROM ( - SELECT d.id store_id, d.name store_name, c.id sku_id, e.name sku_name, a.vendor_id, SUM(IFNULL(a.count,0)) sale_count + SELECT d.id store_id, d.name store_name, c.id sku_id, e.name sku_name, e.id name_id, a.vendor_id, SUM(IFNULL(a.count,0)) sale_count FROM store_sku_bind t LEFT JOIN order_sku a ON t.sku_id = IF(a.jx_sku_id = 0, a.sku_id, a.jx_sku_id) LEFT JOIN goods_order b ON t.store_id = IF(b.jx_store_id = 0, b.store_id, b.jx_store_id) AND a.vendor_id = b.vendor_id AND a.vendor_order_id = b.vendor_order_id @@ -1146,7 +1147,7 @@ func GetStoresSkusSaleInfoNew(ctx *jxcontext.Context, vendorIDs, storeIDs, skuID sql += " AND (e.name LIKE ? OR d.name LIKE ? OR d.id = ? OR a.vendor_order_id = ?)" sqlParams = append(sqlParams, "%"+keyword+"%", "%"+keyword+"%", keyword, keyword) } - sql += " GROUP BY 1, 2, 3, 4, 5" + sql += " GROUP BY 1, 2, 3, 4, 5, 6" if dataMap["saleCountBegin"] != nil || dataMap["saleCountEnd"] != nil { sql += " HAVING" if dataMap["saleCountBegin"] != nil {