Browse Source

Merge branch 'dev_v1.5.27.5_wh' of jianyu/datatools into hotfix/v1.5.27.5

王浩 5 months ago
parent
commit
0afd7d3d08
1 changed files with 9 additions and 0 deletions
  1. 9 0
      clueSync/kc.go

+ 9 - 0
clueSync/kc.go

@@ -2,6 +2,7 @@ package main
 
 import (
 	"app.yhyue.com/moapp/jybase/mail"
+	"app.yhyue.com/moapp/jybase/redis"
 	"database/sql"
 	"encoding/json"
 	"fmt"
@@ -23,6 +24,7 @@ func kcSync() {
 	  and vip_endtime > "` + time.Now().Format(date.Date_Full_Layout) + `" and autoUpdate > "` + cfg.LastkcTime + `" order by autoUpdate asc`
 	//sql := `select * from dwd_f_userbase_order_info where order_code="173943424276"  `
 	data := TiDb.SelectBySql(sql)
+	customList := gconv.Strings(redis.Get("newother", "customList"))
 	if data != nil && *data != nil && len(*data) > 0 {
 		arr := []string{}
 		for _, v := range *data {
@@ -33,13 +35,20 @@ func kcSync() {
 			if (product_type == "大会员" || product_type == "企业商机管理") && ((order_change != 0) || (order_change == 0 && TimeStrcount(vip_starttime, vip_endtime) > 95)) {
 				orderCode := gconv.String(v["order_code"])
 				arr = append(arr, orderCode)
+				for _, v := range customList {
+					if v == orderCode {
+						continue
+					}
+				}
 				status := kcJob(v)
 				if status == 0 {
 					break
 				}
+				customList = append(customList, orderCode)
 			}
 			cfg.LastkcTime = common.ObjToString(v["autoUpdate"])
 		}
+		redis.Put("newother", "customList", customList, 0)
 		log.Println(strings.Join(arr, "`,`"))
 	}
 	common.WriteSysConfig(&cfg)