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
3a3166f7
authored
Sep 03, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加销售部门
parent
abbf9de5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
internal/logic/crm_user.go
internal/logic/crm_user.go
View file @
3a3166f7
...
@@ -19,7 +19,7 @@ const INSERTISCREATEORDER = "INSERT INTO `lie_user_extend` (`user_id`, `no_crea
...
@@ -19,7 +19,7 @@ const INSERTISCREATEORDER = "INSERT INTO `lie_user_extend` (`user_id`, `no_crea
const
INSERTSALES
=
"INSERT INTO `lie_salesman` (`user_id`, `sale_id`,`assign_time`, `update_time`)VALUES(?,?,?,?)"
const
INSERTSALES
=
"INSERT INTO `lie_salesman` (`user_id`, `sale_id`,`assign_time`, `update_time`)VALUES(?,?,?,?)"
const
INSERTINVOICECOMUSER
=
"INSERT INTO `lie_invoice_com_user` (`com_id`, `user_id`, `sale_id`, `
sale_type`, `create_time`)VALUES( ?, ?, ?,
?, ?)"
const
INSERTINVOICECOMUSER
=
"INSERT INTO `lie_invoice_com_user` (`com_id`, `user_id`, `sale_id`, `
department_id`, `sale_type`, `create_time`)VALUES( ?, ?, ?, ?,
?, ?)"
const
INSERTFOLLOWTASK
=
"INSERT INTO `lie_task_info` (user_id, task_id, task_type, task_display_degree, sale_id, end_time, create_time, update_time) VALUES (?,?,?,?,?,?,?,?)"
const
INSERTFOLLOWTASK
=
"INSERT INTO `lie_task_info` (user_id, task_id, task_type, task_display_degree, sale_id, end_time, create_time, update_time) VALUES (?,?,?,?,?,?,?,?)"
...
@@ -63,7 +63,12 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool {
...
@@ -63,7 +63,12 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool {
return
false
return
false
}
}
var
department_id
=
0
if
memberInfo
.
Sale_Id
!=
0
{
if
memberInfo
.
Sale_Id
!=
0
{
err
:=
dao
.
GetCmsDb
()
.
QueryRowx
(
"select department_id from user_info where userId = ?"
,
memberInfo
.
Sale_Id
)
.
Scan
(
&
department_id
)
if
err
!=
nil
{
service
.
WriteErr
(
err
)
}
//插入跟进销售
//插入跟进销售
insertResult
,
err
=
dbTran
.
Exec
(
INSERTSALES
,
lastInsertId
,
memberInfo
.
Sale_Id
,
memberInfo
.
Create_Time
,
memberInfo
.
Create_Time
)
insertResult
,
err
=
dbTran
.
Exec
(
INSERTSALES
,
lastInsertId
,
memberInfo
.
Sale_Id
,
memberInfo
.
Create_Time
,
memberInfo
.
Create_Time
)
...
@@ -83,7 +88,7 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool {
...
@@ -83,7 +88,7 @@ func InsertMemberUser(memberInfo model.MemberAddUserData)bool {
}
}
//插入用户关联关系 20200406新增
//插入用户关联关系 20200406新增
insertResult
,
err
=
dbTran
.
Exec
(
INSERTINVOICECOMUSER
,
0
,
memberInfo
.
User_Id
,
memberInfo
.
Sale_Id
,
memberInfo
.
Channel_type
,
memberInfo
.
Create_Time
)
insertResult
,
err
=
dbTran
.
Exec
(
INSERTINVOICECOMUSER
,
0
,
memberInfo
.
User_Id
,
memberInfo
.
Sale_Id
,
department_id
,
memberInfo
.
Channel_type
,
memberInfo
.
Create_Time
)
if
err
!=
nil
{
if
err
!=
nil
{
service
.
WriteErrDetail
(
"插入用户数据错误:插入用户关联关系"
+
err
.
Error
())
service
.
WriteErrDetail
(
"插入用户数据错误:插入用户关联关系"
+
err
.
Error
())
err
=
dbTran
.
Rollback
()
err
=
dbTran
.
Rollback
()
...
...
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