WH01243 1 månad sedan
förälder
incheckning
951b8e9b45
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      clueSync/kc.go

+ 4 - 1
clueSync/kc.go

@@ -820,8 +820,10 @@ func refundAuto() {
 				})
 				TiDb.UpdateOrDeleteBySql(`UPDATE dwd_f_csm_customer_info SET is_transfer=1 WHERE clue_id = ?`, clueId)
 			} else {
+				log.Println("客成到期处理")
 				order1Sql := fmt.Sprintf(`select  a.id from  dataexport_order  a   INNER JOIN   jy_order_detail   b    on   a.order_code=b.order_code and    a.user_id    in   (%s) and    b.product_type in (%s)  and   order_status = 1  and  b.service_endtime>"%s" ORDER BY  b.service_endtime  desc  `, strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
 				order1 := Mysql.SelectBySql(order1Sql)
+				log.Println("有效订单查询", order1Sql)
 				if order1 == nil || len(*order1) == 0 {
 					isOk := false
 					order3Sql := fmt.Sprintf(`select  a.* ,	b.product_type AS productType,b.service_starttime,b.service_endtime ,b.filter AS productFilter
@@ -830,6 +832,7 @@ func refundAuto() {
              		and   order_status = 1  and  b.service_endtime<"%s" ORDER BY  b.service_endtime  desc  `,
 						strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
 					_, vip_endtime := getOrderData(order3Sql)
+					log.Println("有效订单查询1", order3Sql)
 					if vip_endtime != "" {
 						//获取最后一个订单信息
 						if isRenewalProtection == 1 {
@@ -1064,7 +1067,7 @@ func refundAuto() {
 		}
 		return true
 	}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where is_transfer = 0`)
-	//}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where id =570010`)
+	//}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where clue_id =1891766`)
 
 	//移交电销提醒
 	for i, v := range mailData {