This commit is contained in:
邹宗楠
2024-07-18 09:29:19 +08:00
parent bd0867c346
commit 63be0e54f6

View File

@@ -1,8 +1,6 @@
package dao
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-print/dao"
"time"
)
@@ -12,7 +10,7 @@ func GetBadCommentOrderId(jxStoreId int, startTime, endTime time.Time, foodNameL
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)) + `)" GROUP BY vendor_order_id LIMIT 0, 1000`
order_sku_financial WHERE jx_store_id = ? AND created_at >= ? AND created_at <= ? AND name IN (` + dao.GenQuestionMarks(len(foodNameList)) + `) GROUP BY vendor_order_id LIMIT 0, 1000`
sqlParams = append(sqlParams, []interface{}{
jxStoreId,
endTime,
@@ -20,16 +18,11 @@ func GetBadCommentOrderId(jxStoreId int, startTime, endTime time.Time, foodNameL
foodNameList,
})
globals.SugarLogger.Debugf("sql :==========%s", sql)
globals.SugarLogger.Debugf("parma :==========%s", utils.Format4Output(sqlParams, false))
commentOrder := make([]*badCommentOrder, 0, 0)
if err := GetRows(GetDB(), &commentOrder, sql, sqlParams...); err != nil {
globals.SugarLogger.Debugf("==========err := %v", err)
return "", err
}
globals.SugarLogger.Debugf("==========commentOrder := %s", utils.Format4Output(commentOrder, false))
// 全等于的话就是目标订单
for _, v := range commentOrder {
if v.Count == len(foodNameList) {