Commit 70b358da by 朱继来

调整释放

parent 6234912f
...@@ -42,14 +42,22 @@ func UpdateLimitFollowTime() { ...@@ -42,14 +42,22 @@ func UpdateLimitFollowTime() {
var sales model.Salesman var sales model.Salesman
err = row.StructScan(&sales) err = row.StructScan(&sales)
// 2-1、检查是否为线上销售 // 检查用户渠道,若为线上渠道则执行释放,否则跳过
is_online_sales := IsOnlineSales(sales.Sale_Id) var user_info model.Users
dao.GetNewDb().Get(&user_info, "select * from lie_user where user_id = ?", sales.User_Id)
if !is_online_sales { // 若不属于线上销售,则跳出本次循环 if user_info.Channel_type != 1 {
dao.GetDb().Exec("update lie_salesman set sys_limit = ? where user_id = ?", -1, sales.User_Id)
continue continue
} }
// 2-1、检查是否为线上销售
//is_online_sales := IsOnlineSales(sales.Sale_Id)
//
//if !is_online_sales { // 若不属于线上销售,则跳出本次循环
// dao.GetDb().Exec("update lie_salesman set sys_limit = ? where user_id = ?", -1, sales.User_Id)
// continue
//}
// 2-2、计算限制时间 // 2-2、计算限制时间
limit_follow_time := CalLimitFollowTime(sales.User_Id, sales.Assign_Time) limit_follow_time := CalLimitFollowTime(sales.User_Id, sales.Assign_Time)
......
...@@ -85,7 +85,7 @@ func CompareTime(user_id, limit_follow_time int) { ...@@ -85,7 +85,7 @@ func CompareTime(user_id, limit_follow_time int) {
// 清理新的关联表 // 清理新的关联表
var timeNow = time.Now().Unix() var timeNow = time.Now().Unix()
dao.GetDb().Exec("update `lie_invoice_com_user` set sale_id= ?, update_time = ? where user_id = ?", 0, timeNow, user_info.Outter_uid) dao.GetDb().Exec("update `lie_invoice_com_user` set sale_id = ?, department_id = ?, update_time = ? where user_id = ?", 0, 0, timeNow, user_info.Outter_uid)
// 添加释放日志 // 添加释放日志
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, "释放用户", "", 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