Commit be86df7a by 朱继来

释放用户解除会员系统绑定

parent 5195d530
......@@ -80,11 +80,22 @@ func CompareTime(user_id, limit_follow_time int) {
return
}
free_str := "释放用户"
// 删除跟进记录
dao.GetDb().Exec("delete from lie_salesman where user_id = ?", user_id)
// 解绑会员系统绑定关系
var invoice_com_user_id int
dao.GetLiexinDb().Get(&invoice_com_user_id, "select id from lie_invoice_com_user where user_id = ?, sale_type = ?", user_info.Outter_uid, 1)
if (invoice_com_user_id != 0) {
dao.GetLiexinDb().Exec("update lie_invoice_com_user set status = ? where id = ?", 1, invoice_com_user_id)
free_str += ",已同步解除会员系统的用户绑定关系"
}
// 添加释放日志
dao.GetDb().Exec("insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)", user_id, 2, "释放用户", "", curr_time)
dao.GetDb().Exec("insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)", user_id, 2, free_str, "", curr_time)
service.DingAlert(configs.Ding_crm_task_token, "任务告警:释放用户成功,CRM用户ID:"+ strconv.Itoa(user_id), "")
} else if diff <= 7 * 86400 { // 设置为即将流失用户
......
package liexin
type InvoiceComUser struct {
Id int `json:"id" db:"id"`
Com_id int `json:"com_id" db:"com_id"`
User_Id int `json:"user_id" db:"user_id"`
Sale_Id int `json:"sale_id" db:"sale_id"`
Status int `json:"status" db:"status"`
Sale_Type int `json:"sale_type" db:"sale_type"`
Create_Time int64 `json:"create_time" db:"create_time"`
Update_Time int64 `json:"update_time" db:"update_time"`
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment