From 710d57d4e5651d2749ff1b504b33a4dba7c5ba81 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 14:15:21 +0800 Subject: [PATCH] 1 --- business/model/dao/dao_order_sku_financial.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/business/model/dao/dao_order_sku_financial.go b/business/model/dao/dao_order_sku_financial.go index 497e36e6a..79dc317ad 100644 --- a/business/model/dao/dao_order_sku_financial.go +++ b/business/model/dao/dao_order_sku_financial.go @@ -11,10 +11,13 @@ import ( func GetBadCommentOrderId(jxStoreId int, startTime, endTime time.Time, foodNameList []string) (string, error) { sqlParams := []interface{}{} sql := ` - SELECT count(vendor_order_id) count,vendor_order_id FROM - order_sku_financial WHERE jx_store_id = ? AND created_at >= ? AND created_at <= ? AND name IN (` + dao.GenQuestionMarks(len(foodNameList)) + `) AND is_afs_order = 0 AND vendor_id = 1 GROUP BY vendor_order_id LIMIT 0, 1000` + SELECT count(s.vendor_order_id) count,s.vendor_order_id FROM goods_order g + LEFT JOIN order_sku s ON g.vendor_order_id = s.vendor_order_id + WHERE g.jx_store_id = ? AND g.vendor_id = ? AND g.order_created_at >= ? AND g.order_created_at <= ? AND s.sku_name IN (` + dao.GenQuestionMarks(len(foodNameList)) + `) GROUP BY s.vendor_order_id LIMIT 0, 1000 +` sqlParams = append(sqlParams, []interface{}{ jxStoreId, + model.VendorIDMTWM, startTime, endTime, foodNameList, @@ -37,10 +40,10 @@ func GetBadCommentOrderId(jxStoreId int, startTime, endTime time.Time, foodNameL } } - sql2 := `SELECT * FROM order_sku_financial WHERE vendor_order_id = ? AND is_afs_order = 0 AND vendor_id = 1 ` + sql2 := `SELECT * FROM order_sku WHERE vendor_order_id = ?` mathProbability := make(map[string]float64, 0) for _, v := range vendorOrderIdList { - skuFinancial := make([]*model.OrderSkuFinancial, 0, 0) + skuFinancial := make([]*model.OrderSku, 0, 0) if err := GetRows(GetDB(), &skuFinancial, sql2, []interface{}{v}...); err != nil { continue } @@ -48,7 +51,7 @@ func GetBadCommentOrderId(jxStoreId int, startTime, endTime time.Time, foodNameL var skuMatchingCount int = 0 for _, sf := range skuFinancial { for _, fnl := range foodNameList { - if sf.Name == fnl { + if sf.SkuName == fnl { skuMatchingCount += 1 } }