|
@@ -21,7 +21,7 @@ func kcSync() {
|
|
|
sql := `select * from dwd_f_userbase_order_info where (payable_money > 0 or (payable_money=0 and ( filter like "%分期付款补充权益%" or filter like "%原订单不支持开通多项权益%" or filter like "%权益码兑换%")))
|
|
|
and data_spec!="dhy4" and order_status=1 and (refund_status!=1 or refund_status is null ) and vip_starttime<"2099-01-01"
|
|
|
and vip_endtime > "` + time.Now().Format(date.Date_Full_Layout) + `" and autoUpdate > "` + cfg.LastkcTime + `" order by autoUpdate asc`
|
|
|
- //sql := `select * from dwd_f_userbase_order_info where order_code="152504013602" `
|
|
|
+ //sql := `select * from dwd_f_userbase_order_info where order_code="173943424276" `
|
|
|
data := TiDb.SelectBySql(sql)
|
|
|
if data != nil && *data != nil && len(*data) > 0 {
|
|
|
arr := []string{}
|
|
@@ -216,7 +216,7 @@ func kcJob(data map[string]interface{}) int {
|
|
|
"name": customerName,
|
|
|
"position_id": customerPositionId,
|
|
|
}
|
|
|
- if is_transfer == 1 {
|
|
|
+ if is_transfer == 1 || customerPositionId != gconv.Int64((*csmdata)["position_id"]) {
|
|
|
//重新进去
|
|
|
updateMap["relationship_building_way"] = 1
|
|
|
updateMap["tasksource"] = "1"
|
|
@@ -242,7 +242,7 @@ func kcJob(data map[string]interface{}) int {
|
|
|
"position_id": customerPositionId,
|
|
|
"change_field": "position_id",
|
|
|
"change_type": "客户成功经理",
|
|
|
- "old_value": common.If(oldName != customerName, customerName, common.If(oldName == "", "/", oldName)),
|
|
|
+ "old_value": common.If(oldName != customerName, oldName, common.If(oldName == "", "/", oldName)),
|
|
|
"new_value": customerName,
|
|
|
"createtime": nowTime,
|
|
|
"BCPCID": common.GetRandom(32),
|
|
@@ -258,7 +258,7 @@ func kcJob(data map[string]interface{}) int {
|
|
|
"operator_id": -1,
|
|
|
})
|
|
|
}
|
|
|
- if is_transfer == 1 && customerPositionId != gconv.Int64((*csmdata)["position_id"]) {
|
|
|
+ if is_transfer == 1 || customerPositionId != gconv.Int64((*csmdata)["position_id"]) {
|
|
|
if customerName == db.KeCheng.Admin {
|
|
|
TiDb.UpdateOrDeleteBySql(`update dwd_f_csm_customer_autodraw_record set count = count + 2 where name = ?`, customerName)
|
|
|
} else {
|