Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CnChunfeng
/
crm_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d53280a0
authored
Jul 21, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整离职人员客户释放
parent
7ee1a0fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
cmd/queue/online_sales_leave/main.go
cmd/queue/online_sales_leave/main.go
View file @
d53280a0
...
@@ -119,6 +119,10 @@ func consume(sale_id int) {
...
@@ -119,6 +119,10 @@ func consume(sale_id int) {
is_order
:=
handle
.
IsOrder
(
sales
.
User_Id
)
is_order
:=
handle
.
IsOrder
(
sales
.
User_Id
)
if
!
is_order
{
// 释放未下单用户
if
!
is_order
{
// 释放未下单用户
// 获取当前用户信息
var
user_info
model
.
Users
dao
.
GetDb
()
.
Get
(
&
user_info
,
"select user_id,outter_uid,is_free,free_time,is_churn from lie_user where user_id = ?"
,
sales
.
User_Id
)
curr_time
:=
time
.
Now
()
.
Unix
()
curr_time
:=
time
.
Now
()
.
Unix
()
_
,
err
:=
dao
.
GetDb
()
.
Exec
(
"update lie_user set is_free = ?, free_time = ?, is_churn = ? where user_id = ?"
,
1
,
curr_time
,
0
,
sales
.
User_Id
)
_
,
err
:=
dao
.
GetDb
()
.
Exec
(
"update lie_user set is_free = ?, free_time = ?, is_churn = ? where user_id = ?"
,
1
,
curr_time
,
0
,
sales
.
User_Id
)
...
@@ -131,6 +135,9 @@ func consume(sale_id int) {
...
@@ -131,6 +135,9 @@ func consume(sale_id int) {
// 删除跟进记录
// 删除跟进记录
dao
.
GetDb
()
.
Exec
(
"delete from lie_salesman where user_id = ?"
,
sales
.
User_Id
)
dao
.
GetDb
()
.
Exec
(
"delete from lie_salesman where user_id = ?"
,
sales
.
User_Id
)
// 清理新的关联表
dao
.
GetDb
()
.
Exec
(
"update `lie_invoice_com_user` set sale_id= ?, update_time = ? where user_id = ?"
,
0
,
curr_time
,
user_info
.
Outter_uid
)
// 添加释放日志
// 添加释放日志
dao
.
GetDb
()
.
Exec
(
"insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)"
,
sales
.
User_Id
,
2
,
"释放用户"
,
"客服离职"
,
curr_time
)
dao
.
GetDb
()
.
Exec
(
"insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)"
,
sales
.
User_Id
,
2
,
"释放用户"
,
"客服离职"
,
curr_time
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment