瀏覽代碼

客成销售人员查询处理

WH01243 3 月之前
父節點
當前提交
1a464efbab
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      clueSync/kc.go

+ 4 - 6
clueSync/kc.go

@@ -816,14 +816,14 @@ func refundAuto() {
 				})
 				TiDb.UpdateOrDeleteBySql(`UPDATE dwd_f_csm_customer_info SET is_transfer=1 WHERE clue_id = ?`, clueId)
 			} else {
-				order1Sql := fmt.Sprintf(`select  refund_status 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  vip_endtime>%s ORDER BY  b.service_endtime  desc  `, strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
+				order1Sql := fmt.Sprintf(`select  refund_status 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  vip_endtime>"%s" ORDER BY  b.service_endtime  desc  `, strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
 				order1 := Mysql.SelectBySql(order1Sql)
 				if order1 == nil || len(*order1) == 0 {
 					isOk := false
 					order3Sql := fmt.Sprintf(`select  a.refund_status,	b.product_type AS productType,b.service_starttime,b.service_endtime ,b.filter AS productFilter
 					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  vip_endtime<%s ORDER BY  b.service_endtime  desc  `,
+             		and   order_status = 1  and  vip_endtime<"%s" ORDER BY  b.service_endtime  desc  `,
 						strings.Join(personArr, ","), strings.Join(productArr, ","), findNowTime)
 					_, vip_endtime := getOrderData(order3Sql)
 					if vip_endtime != "" {
@@ -1443,8 +1443,7 @@ func FindPositionIdClueId(uid string) (int64, string, string) {
 		INNER JOIN   dwd_f_crm_personnel_management c   on c.ent_id =?  and    e.name=c.name 
 		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,
-			a.money desc `, strings.Join(personArr, ","), "9%", strings.Join(productArr, ","))
+		b.service_endtime desc ,b.final_price DESC `, strings.Join(personArr, ","), "9%", strings.Join(productArr, ","))
 	clueData := TiDb.SelectBySql(querySql, db.EntId)
 	if clueData == nil || len(*clueData) == 0 {
 		return 0, "", ""
@@ -1502,8 +1501,7 @@ func FindSaleRecord(orderCode string) (dept string, positionId int64, position s
 		SELECT DISTINCT
 			a.saler_dept,
 			a.saler_name,
-			b.phone,
-			a.money
+			b.phone
 		FROM
 			order_sale_record a
 			INNER JOIN entniche_user  b