From ec2ef68e1e851e10f83bb3adb32ce4b9f85ed0db Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 24 May 2024 11:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/bigData/svc/svc_data.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/bigData/svc/svc_data.go b/app/bigData/svc/svc_data.go index 8147fef..fbb8e09 100644 --- a/app/bigData/svc/svc_data.go +++ b/app/bigData/svc/svc_data.go @@ -484,7 +484,7 @@ func NewSortingData(c *gin.Context) []map[string]string { } oIds = append(oIds, utils.Int64ToStr(v.Oid)) } - sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku FROM order_goods WHERE oid in (%s) GROUP BY enterprise_id,goods_id,sku_id` + sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku FROM order_goods WHERE oid in (%s) and goods_type=0 GROUP BY enterprise_id,goods_id,sku_id` sql = fmt.Sprintf(sql, strings.Join(oIds, ",")) nativeString, err := db.QueryNativeString(engine, sql) for _, v := range nativeString { @@ -535,7 +535,7 @@ func NewSortingGoodsCate() []map[string]string { } oIds = append(oIds, utils.Int64ToStr(v.Oid)) } - sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku,goods_id,sku_id FROM order_goods WHERE oid in (%s) GROUP BY goods_id,sku_id` + sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku,goods_id,sku_id FROM order_goods WHERE oid in (%s) and goods_type=0 GROUP BY goods_id,sku_id` sql = fmt.Sprintf(sql, strings.Join(oIds, ",")) nativeString, err := db.QueryNativeString(engine, sql) for _, v := range nativeString { @@ -597,7 +597,7 @@ func NewSortingGoodsData(arg map[string]string) []map[string]string { } oIds = append(oIds, utils.Int64ToStr(v.Oid)) } - sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku,goods_id,sku_id,enterprise_id FROM order_goods WHERE oid in (%s) and goods_id=%s and sku_id=%s GROUP BY enterprise_id` + sql := `SELECT SUM(num) as num,SUM(success_num) as success_num,goods_title,sku,goods_id,sku_id,enterprise_id FROM order_goods WHERE oid in (%s) and goods_id=%s and goods_type=0 and sku_id=%s GROUP BY enterprise_id` sql = fmt.Sprintf(sql, strings.Join(oIds, ","), arg["goods_id"], arg["sku_id"]) nativeString, err := db.QueryNativeString(engine, sql) for _, v := range nativeString {