Ver Fonte

Merge branch 'dev_v1.5.34_wh' of jianyu/datatools into feature/v1.5.34

王浩 há 1 mês atrás
pai
commit
1cc7d2ff25
1 ficheiros alterados com 4 adições e 3 exclusões
  1. 4 3
      clueSync/kc.go

+ 4 - 3
clueSync/kc.go

@@ -822,8 +822,8 @@ func refundAuto() {
 			} 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)
+				order1 := Mysql.SelectBySql(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
@@ -831,8 +831,8 @@ func refundAuto() {
     				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)
-					_, vip_endtime := getOrderData(order3Sql)
 					log.Println("有效订单查询1", order3Sql)
+					_, vip_endtime := getOrderData(order3Sql)
 					if vip_endtime != "" {
 						//获取最后一个订单信息
 						if isRenewalProtection == 1 {
@@ -1067,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 clue_id =1892226`)
+	//}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where clue_id =1892234`)
 
 	//移交电销提醒
 	for i, v := range mailData {
@@ -1451,6 +1451,7 @@ func FindPositionIdClueId(uid string) (int64, string, string) {
 		inner  join dwd_d_crm_department_level_succbi  f  on   c.position_id=f.position_id
 	ORDER BY
 		b.service_endtime desc ,b.final_price DESC `, strings.Join(personArr, ","), "9%", strings.Join(productArr, ","))
+	log.Println("业绩归属查询:", querySql)
 	clueData := TiDb.SelectBySql(querySql, db.EntId)
 	if clueData == nil || len(*clueData) == 0 {
 		return 0, "", ""