Commit 6c0ece06 by 朱继来

下单、新增用户分配客服添加操作日志

parent 0f0fc0aa
...@@ -81,8 +81,8 @@ func CompareTime(user_id, limit_follow_time int) { ...@@ -81,8 +81,8 @@ func CompareTime(user_id, limit_follow_time int) {
return return
} }
// 限制跟进时间标为0 // 删除跟进记录
dao.GetDb().Exec("update lie_salesman set limit_follow_time = ?, update_time = ? where user_id = ?", 0, curr_time, user_id) dao.GetDb().Exec("delete from lie_salesman where user_id = ?", user_id)
// 添加释放日志 // 添加释放日志
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)
......
...@@ -107,7 +107,7 @@ func handle(userId,saleId int)(result bool) { ...@@ -107,7 +107,7 @@ func handle(userId,saleId int)(result bool) {
_,err := dao.GetDb().Exec("update lie_salesman set assign_time = ?,update_time = ?,sale_id= ? where user_id = ?",timeNow,timeNow,saleId,crmUserId) _,err := dao.GetDb().Exec("update lie_salesman set assign_time = ?,update_time = ?,sale_id= ? where user_id = ?",timeNow,timeNow,saleId,crmUserId)
fmt.Println(err) fmt.Println(err)
} }
_,err := dao.GetDb().Exec("insert into lie_action_log(`user_id`,`operator_id`,`create_time`,`remark`,`admin`,`event`)value(?,?,?,'转为已下单用户','admin','用户下单')",crmUserId,saleId,timeNow) _,err := dao.GetDb().Exec("insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)", crmUserId, 2, "用户下单", "自动分配客服,客服ID:"+ strconv.Itoa(saleId), timeNow)
fmt.Println(err) fmt.Println(err)
return true return true
} }
......
...@@ -4,6 +4,8 @@ import ( ...@@ -4,6 +4,8 @@ import (
"crm-server/internal/dao" "crm-server/internal/dao"
"crm-server/internal/model" "crm-server/internal/model"
"crm-server/internal/service" "crm-server/internal/service"
"strconv"
"time"
) )
const INSERTCRMUSER = "INSERT INTO `lie_user` (" + const INSERTCRMUSER = "INSERT INTO `lie_user` (" +
...@@ -83,6 +85,10 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool { ...@@ -83,6 +85,10 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool {
err = dbTran.Rollback() err = dbTran.Rollback()
return false return false
} }
curr_time := time.Now().Unix()
dbTran.Exec("insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)", lastInsertId, 2, "新增用户", "自动分配客服,客服ID:"+ strconv.Itoa(memberInfo.Sale_Id), curr_time)
dbTran.Commit() dbTran.Commit()
return true return true
} }
\ No newline at end of file
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