浏览代码

进客成商品选择

WH01243 3 月之前
父节点
当前提交
ca7a8dc713
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      clueSync/kc.go

+ 5 - 3
clueSync/kc.go

@@ -41,11 +41,13 @@ FROM
 	AND ( a.refund_status != 1 OR a.refund_status IS NULL ) 
 	AND b.service_starttime < "2099-01-01" AND b.service_endtime > now() 
 	AND b.update_time > "%s"
+
 ORDER BY
-	b.update_time ASC,
 	a.order_code ASC,
+	difference desc ,
 	b.final_price DESC `
 	sql = fmt.Sprintf(sql, strings.Join(productArr, ","), "9%", cfg.LastkcTime)
+	//sql = fmt.Sprintf(sql, strings.Join(productArr, ","), "9%", "2025-01-02", "103557341197")
 	data := Mysql.SelectBySql(sql)
 	fmt.Println("客成查询到的数量:", len(*data))
 	customList := gconv.Strings(redis.Get("newother", "customList"))
@@ -62,7 +64,7 @@ ORDER BY
 				isExit := false
 				for _, v := range customList {
 					if v == orderCode {
-						isExit = true
+						//isExit = true
 						continue
 					}
 				}
@@ -79,7 +81,7 @@ ORDER BY
 					data := orderMap[orderCode]
 					//商品类型获取
 					oldDifference := gconv.Int(data["difference"])
-					if oldDifference >= difference {
+					if oldDifference < difference {
 						//需要更换
 						v["difference"] = difference
 						v["product"] = productInt64