WH01243 3 ماه پیش
والد
کامیت
06fd453bcf
2فایلهای تغییر یافته به همراه8 افزوده شده و 6 حذف شده
  1. 2 5
      clueSync/kc.go
  2. 6 1
      clueSync/tag.go

+ 2 - 5
clueSync/kc.go

@@ -1059,7 +1059,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 =570013`)
+	//}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where id =570010`)
 
 	//移交电销提醒
 	for i, v := range mailData {
@@ -1814,7 +1814,6 @@ func KcOrderFormat(orderCode string) *OrderInfo {
 	}, `select id,s_name from jianyu.bigmember_service`)
 	orderData := Mysql.SelectBySql(fmt.Sprintf(`
 		SELECT
-		a.id,
 		a.order_code,
 		a.pay_money,
 		a.user_phone,
@@ -1833,10 +1832,8 @@ func KcOrderFormat(orderCode string) *OrderInfo {
 		jianyu.dataexport_order a
 		INNER JOIN jy_order_detail b on   a.order_code ="%s"  and   a.order_code = b.order_code and  a.order_status = 1  and  b.product_type in (%s)
 		LEFT JOIN return_money_record c ON  a.order_code = c.order_code 
-	GROUP BY
-		a.id 
 	ORDER  BY
-		b.update_time desc  ,difference desc  
+		difference desc  
 	`, orderCode, strings.Join(productArr, ",")))
 	data := &OrderInfo{}
 	if orderData != nil && len(*orderData) > 0 {

+ 6 - 1
clueSync/tag.go

@@ -112,8 +112,13 @@ func FormatTag(data map[string]interface{}, count int) {
 		search_wordss = strings.Join(search_words_arr, ",")
 	}
 	//订单购买的服务
-	orderData := TiDb.Find("dwd_f_userbase_order_info", map[string]interface{}{"userid": userId, "order_status": 1, "delete_status": 0}, "", "", -1, -1)
+	//orderData := TiDb.Find("dwd_f_userbase_order_info", map[string]interface{}{"userid": userId, "order_status": 1, "delete_status": 0}, "", "", -1, -1)
 	//orderData := TiDb.SelectBySql("select  *  from  dwd_f_userbase_order_info where   userid=? and  order_status=1 and  delete_status=0 and  payable_money > 0", userId)
+	orderSql := `select  a.*,b.product_type as  productType from  dataexport_order  a   
+    INNER JOIN   jy_order_detail   b    on   a.order_code=b.order_code and    a.user_id    = "%s"   and 
+    a.order_status = 1  and  a.del_status =0 
+    ORDER BY  b.service_endtime  desc `
+	orderData := TiDb.SelectBySql(orderSql, userId)
 	if orderData != nil && len(*orderData) > 0 {
 		product_type_arr, product_type_arrs := []string{}, []string{}
 		for _, v := range *orderData {