瀏覽代碼

大客数据处理

WH01243 7 月之前
父節點
當前提交
7d684e3511
共有 3 個文件被更改,包括 12 次插入2 次删除
  1. 1 0
      clueSync/config.go
  2. 2 1
      clueSync/db.json
  3. 9 1
      clueSync/kc.go

+ 1 - 0
clueSync/config.go

@@ -192,6 +192,7 @@ type (
 		OperationEmail   []string          `json:"operationEmail"`
 		ExpirationPeriod int               `json:"expirationPeriod"` //客成到期周期
 		HandoverCycle    int64             `json:"handoverCycle"`    //移交周期
+		CustomerTime     int64             `json:"customerTime"`     //客成时间
 	}
 )
 

+ 2 - 1
clueSync/db.json

@@ -163,5 +163,6 @@
   "abhEmail": "wanghao@topnet.net.cn",
   "newRegistration": 1,
   "expirationPeriod": 30,
-  "handoverCycle": 60
+  "handoverCycle": 60,
+  "customerTime": 1733846400
 }

+ 9 - 1
clueSync/kc.go

@@ -661,8 +661,16 @@ func refundAuto() {
 							if isRenewalProtection == 1 {
 								vip_endtime := common.ObjToString(vv["vip_endtime"])
 								vip_endtimes, _ := time.ParseInLocation(date.Date_Full_Layout, vip_endtime, time.Local)
+								//查询申请保护时间
+								renewalTime := time.Time{}
+								timeData := TiDb.SelectBySql(`select  max(createtime) as createtime from   dwd_f_crm_clue_change_record   where   clue_id =  ? `, clueId)
+								if timeData != nil && len(*timeData) > 0 {
+									renewalTime, _ = time.ParseInLocation(date.Date_Full_Layout, gconv.String((*timeData)[0]["createtime"]), time.Local)
+								}
+								renewalInt := renewalTime.Unix()
+								log.Println("申请保护期时间", clueId, renewalInt)
 								//查看服务到期时间
-								if vip_endtimes.Unix() <= db.CustomerTime {
+								if renewalInt != 0 && renewalInt < db.CustomerTime {
 									//三个月
 									if time.Now().Unix()-vip_endtimes.Unix() < 3*30*86400 {
 										isOk = true