Commit 760fb1fe by 朱继来

线下新增用户添加跟进任务

parent c68abb76
Showing with 19 additions and 2 deletions
...@@ -19,9 +19,10 @@ const INSERTISCREATEORDER = "INSERT INTO `lie_user_extend` (`user_id`, `no_crea ...@@ -19,9 +19,10 @@ const INSERTISCREATEORDER = "INSERT INTO `lie_user_extend` (`user_id`, `no_crea
const INSERTSALES = "INSERT INTO `lie_salesman` (`user_id`, `sale_id`,`assign_time`, `update_time`)VALUES(?,?,?,?)" const INSERTSALES = "INSERT INTO `lie_salesman` (`user_id`, `sale_id`,`assign_time`, `update_time`)VALUES(?,?,?,?)"
const INSERTINVOICECOMUSER = "INSERT INTO `lie_invoice_com_user` (`com_id`, `user_id`, `sale_id`, `sale_type`, `create_time`)VALUES( ?, ?, ?, ?, ?)" const INSERTINVOICECOMUSER = "INSERT INTO `lie_invoice_com_user` (`com_id`, `user_id`, `sale_id`, `sale_type`, `create_time`)VALUES( ?, ?, ?, ?, ?)"
const INSERTFOLLOWTASK = "INSERT INTO `lie_task_info` (user_id, task_id, task_type, task_display_degree, sale_id, end_time, create_time, update_time) VALUES (?,?,?,?,?,?,?,?)"
//检测会员用户是否存在 //检测会员用户是否存在
func CheckMemberIdIsHave(memberId int)(returnUserId int){ func CheckMemberIdIsHave(memberId int)(returnUserId int){
...@@ -97,11 +98,27 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool { ...@@ -97,11 +98,27 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool {
return false return false
} }
curr_time := time.Now().Unix()
// 若是线下用户,则新增跟进用户任务
if memberInfo.Channel_type == 2 || memberInfo.Channel_type == 3 {
var task_setup model.TaskSetup
dao.GetNewDb().Get(&task_setup, "select * from lie_task_setup where task_type = ?", 10)
if task_setup.Id != 0 {
var task_setup_details model.TaskSetupDetails
dao.GetNewDb().Get(&task_setup_details, "select * from lie_task_setup_details where task_id = ?", task_setup.Id)
var task_end_time int64
task_end_time = curr_time + (task_setup_details.TaskEndTime * 60)
dbTran.Exec(INSERTFOLLOWTASK, lastInsertId, task_setup.Id, task_setup.TaskType, task_setup.TaskDisplayDegree, memberInfo.Sale_Id, task_end_time, curr_time, curr_time)
}
}
var event string var event string
if memberInfo.Sale_Id != 0 { if memberInfo.Sale_Id != 0 {
event = "已指派客服,客服ID:"+ strconv.Itoa(memberInfo.Sale_Id) event = "已指派客服,客服ID:"+ strconv.Itoa(memberInfo.Sale_Id)
} }
curr_time := time.Now().Unix()
dbTran.Exec("insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)", lastInsertId, 2, "新增用户", event, curr_time) dbTran.Exec("insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)", lastInsertId, 2, "新增用户", event, curr_time)
dbTran.Commit() dbTran.Commit()
......
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