Commit d53280a0 by 朱继来

调整离职人员客户释放

parent 7ee1a0fd
Showing with 7 additions and 0 deletions
......@@ -119,6 +119,10 @@ func consume(sale_id int) {
is_order := handle.IsOrder(sales.User_Id)
if !is_order { // 释放未下单用户
// 获取当前用户信息
var user_info model.Users
dao.GetDb().Get(&user_info, "select user_id,outter_uid,is_free,free_time,is_churn from lie_user where user_id = ?", sales.User_Id)
curr_time := time.Now().Unix()
_, err := dao.GetDb().Exec("update lie_user set is_free = ?, free_time = ?, is_churn = ? where user_id = ?", 1, curr_time, 0, sales.User_Id)
......@@ -131,6 +135,9 @@ func consume(sale_id int) {
// 删除跟进记录
dao.GetDb().Exec("delete from lie_salesman where user_id = ?", sales.User_Id)
// 清理新的关联表
dao.GetDb().Exec("update `lie_invoice_com_user` set sale_id= ?, update_time = ? where user_id = ?", 0, curr_time, user_info.Outter_uid)
// 添加释放日志
dao.GetDb().Exec("insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)", sales.User_Id, 2, "释放用户", "客服离职", curr_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