Commit 304305b5 by 朱继来

1. 新增用户去掉客服池分配;

2. 快速找料若无分配,则调用客服池;
parent e406b690
......@@ -108,10 +108,27 @@ func setFindGoods(status, task_id, task_type, task_display_degree int) {
var salesman model.Salesman
db.Get(&salesman, "select * from lie_salesman where user_id = ?", feedback.Outter_Uid)
if salesman.Sale_Id == 0 { // 若未分配,则跳过
if salesman.Sale_Id == 0 { // 若未分配,则从客服池获取
var kefu model.Kefu
db.Get(&kefu,"select * from lie_kefu where status = ?",1)
if kefu.SaleId == 0 {
continue
}
salesman.Sale_Id = kefu.SaleId
// 删除后新增到末尾,并重新设置第一条为‘待分配’
db.Exec("delete from lie_kefu where sale_id = ?", kefu.SaleId)
current_time := time.Now().Unix()
db.Exec("insert into lie_kefu (sale_id, sale_name, email, operator_id, operator_name, create_time, update_time) values (?, ?, ?, ?, ?, ?, ?)", kefu.SaleId,
kefu.SaleName, kefu.Email, kefu.OperatorId, kefu.OperatorName, current_time, current_time)
var first_kefu model.Kefu
db.Get(&first_kefu, "select * from lie_kefu order by id asc limit 1")
db.Exec("update lie_kefu set status = ?, update_time = ? where id = ?", 1, current_time, first_kefu.Id)
}
db.Exec("insert into lie_task_info (user_id, task_id, task_type, task_display_degree, sale_id, create_time, update_time) value (?, ?, ?, ?, " +
"?, ?, ?)", feedback.Outter_Uid, task_id, task_type, task_display_degree, salesman.Sale_Id, current_time, current_time)
db.Exec("update lie_feedback set is_add_task = ? where id = ?", 1, feedback.Id)
......
......@@ -9,7 +9,6 @@ import (
"regexp"
"strconv"
"strings"
"time"
)
//会员系统的用户逻辑
......@@ -67,7 +66,7 @@ func SetTagSale(tag string,memberInfo *model.MemberAddUserData){
1. 从平台订单表lie_order获取最近一笔订单的客服;
2. 若用户从会员系统后台注册,默认分配给当前操作人员,通过lie_user_info获取客服;
3. 通过注册用户url携带参数(adtag、ptag),结合CRM自动分配表,获取指定客服;
4. CRM客服池自动分配;
4. CRM客服池自动分配;(已注释 -- 20201225)
*/
func HandleData(MemberUserInfo model.MemberAddUserData) model.MemberAddUserData{
......@@ -161,22 +160,24 @@ func HandleData(MemberUserInfo model.MemberAddUserData) model.MemberAddUserData{
}
// 若前三种方式都没获取到sale_id,则从客服池中获取
if MemberUserInfo.Sale_Id == 0 {
var kefu model.Kefu
dao.GetDb().Get(&kefu,"select * from lie_kefu where status = ?",1)
MemberUserInfo.Sale_Id = kefu.SaleId
// 删除后新增到末尾,并重新设置第一条为‘待分配’
dao.GetDb().Exec("delete from lie_kefu where sale_id = ?", kefu.SaleId)
current_time := time.Now().Unix()
dao.GetDb().Exec("insert into lie_kefu (sale_id, sale_name, email, operator_id, operator_name, create_time, update_time) values (?, ?, ?, ?, ?, ?, ?)", kefu.SaleId,
kefu.SaleName, kefu.Email, kefu.OperatorId, kefu.OperatorName, current_time, current_time)
var first_kefu model.Kefu
dao.GetDb().Get(&first_kefu, "select * from lie_kefu order by id asc limit 1")
dao.GetDb().Exec("update lie_kefu set status = ?, update_time = ? where id = ?", 1, current_time, first_kefu.Id)
}
//if MemberUserInfo.Sale_Id == 0 {
// var kefu model.Kefu
// dao.GetDb().Get(&kefu,"select * from lie_kefu where status = ?",1)
//
// if kefu.SaleId != 0 {
// MemberUserInfo.Sale_Id = kefu.SaleId
//
// // 删除后新增到末尾,并重新设置第一条为‘待分配’
// dao.GetDb().Exec("delete from lie_kefu where sale_id = ?", kefu.SaleId)
// current_time := time.Now().Unix()
// dao.GetDb().Exec("insert into lie_kefu (sale_id, sale_name, email, operator_id, operator_name, create_time, update_time) values (?, ?, ?, ?, ?, ?, ?)", kefu.SaleId,
// kefu.SaleName, kefu.Email, kefu.OperatorId, kefu.OperatorName, current_time, current_time)
//
// var first_kefu model.Kefu
// dao.GetDb().Get(&first_kefu, "select * from lie_kefu order by id asc limit 1")
// dao.GetDb().Exec("update lie_kefu set status = ?, update_time = ? where id = ?", 1, current_time, first_kefu.Id)
// }
//}
//地址
if MemberUserInfo.Com_Province_Id != 0 && MemberUserInfo.Com_City_Id != 0 && MemberUserInfo.Com_Area_Id != 0 {
......
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