Commit 6608bf38 by 朱继来

调整找料

parent bc4be0db
Showing with 6 additions and 6 deletions
...@@ -109,9 +109,9 @@ func setFindGoods(status, task_id, task_type, task_display_degree int) { ...@@ -109,9 +109,9 @@ func setFindGoods(status, task_id, task_type, task_display_degree int) {
var salesman model.InvoiceComUser var salesman model.InvoiceComUser
db.Get(&salesman, "select * from lie_invoice_com_user where user_id = ?", feedback.User_Id) db.Get(&salesman, "select * from lie_invoice_com_user where user_id = ?", feedback.User_Id)
if salesman.Sale_Id == 0 { // 若未分配,则从客服获取 if salesman.Sale_Id == 0 { // 若未分配,则从客服获取
var kefu model.Kefu var kefu model.Kefu
db.Get(&kefu,"select * from lie_kefu where status = ?",1) db.Get(&kefu,"select * from lie_kefu where status = ? and type = ?",1, 2)
if kefu.SaleId == 0 { if kefu.SaleId == 0 {
continue continue
...@@ -120,13 +120,13 @@ func setFindGoods(status, task_id, task_type, task_display_degree int) { ...@@ -120,13 +120,13 @@ func setFindGoods(status, task_id, task_type, task_display_degree int) {
salesman.Sale_Id = kefu.SaleId salesman.Sale_Id = kefu.SaleId
// 删除后新增到末尾,并重新设置第一条为‘待分配’ // 删除后新增到末尾,并重新设置第一条为‘待分配’
db.Exec("delete from lie_kefu where sale_id = ? and type = 1", kefu.SaleId) db.Exec("delete from lie_kefu where sale_id = ? and type = ?", kefu.SaleId, 2)
current_time := time.Now().Unix() 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, db.Exec("insert into lie_kefu (sale_id, sale_name, email, type, operator_id, operator_name, create_time, update_time) values (?, ?, ?, ?, ?, ?, ?, ?)", kefu.SaleId,
kefu.SaleName, kefu.Email, kefu.OperatorId, kefu.OperatorName, current_time, current_time) kefu.SaleName, kefu.Email, 2, kefu.OperatorId, kefu.OperatorName, current_time, current_time)
var first_kefu model.Kefu var first_kefu model.Kefu
db.Get(&first_kefu, "select * from lie_kefu where type = 1 order by id asc limit 1") db.Get(&first_kefu, "select * from lie_kefu where type = 2 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("update lie_kefu set status = ?, update_time = ? where id = ?", 1, current_time, first_kefu.Id)
// 分配客服,添加日志 // 分配客服,添加日志
......
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