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
f625d841
authored
Apr 14, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改关联表
parent
e5cd0dcc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
cmd/queue/update_user_sale/main.go
cmd/queue/update_user_sale/main.go
View file @
f625d841
...
@@ -104,12 +104,22 @@ func handle(userId,saleId int)(result bool) {
...
@@ -104,12 +104,22 @@ func handle(userId,saleId int)(result bool) {
_
,
err
:=
dao
.
GetDb
()
.
Exec
(
"INSERT INTO `lie_salesman` ( `user_id`, `sale_id`, `assign_time`, `update_time`)VALUES(?,?,?,?)"
,
crmUserId
,
saleId
,
timeNow
,
timeNow
)
_
,
err
:=
dao
.
GetDb
()
.
Exec
(
"INSERT INTO `lie_salesman` ( `user_id`, `sale_id`, `assign_time`, `update_time`)VALUES(?,?,?,?)"
,
crmUserId
,
saleId
,
timeNow
,
timeNow
)
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
}
else
{
}
else
{
_
,
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
update_time = ?,sale_id= ? where user_id = ?"
,
timeNow
,
saleId
,
crmUserId
)
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
}
}
// 修改新的关联表 lie_invoice_com_user
var
invUserId
int
_
=
dao
.
GetDb
()
.
QueryRowx
(
"select user_id from lie_invoice_com_user where user_id = ?"
,
userId
)
.
Scan
(
&
invUserId
)
if
invUserId
==
0
{
dao
.
GetDb
()
.
Exec
(
"INSERT INTO `lie_invoice_com_user` ( `user_id`, `sale_id`, `create_time`, `update_time`)VALUES(?,?,?,?)"
,
userId
,
saleId
,
timeNow
,
timeNow
)
}
else
{
dao
.
GetDb
()
.
Exec
(
"update `lie_invoice_com_user` set sale_id= ?, status = ?, update_time = ? where user_id = ?"
,
saleId
,
0
,
timeNow
,
userId
)
}
dao
.
GetDb
()
.
Exec
(
"update lie_user set is_free = ?, free_time = ? where user_id = ?"
,
0
,
0
,
crmUserId
)
dao
.
GetDb
()
.
Exec
(
"update lie_user set is_free = ?, free_time = ? where user_id = ?"
,
0
,
0
,
crmUserId
)
_
,
err
:=
dao
.
GetDb
()
.
Exec
(
"insert into lie_action_log (user_id, type, event, remark, create_time) values (?, ?, ?, ?, ?)"
,
crmUserId
,
2
,
"用户下单"
,
"
自动
分配客服,客服ID:"
+
strconv
.
Itoa
(
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
}
}
...
...
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