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
6234912f
authored
Sep 07, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整释放脚本
parent
3a3166f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
cmd/follow/handle/salesman.go
cmd/follow/handle/salesman.go
View file @
6234912f
...
...
@@ -42,10 +42,10 @@ func UpdateLimitFollowTime() {
var
sales
model
.
Salesman
err
=
row
.
StructScan
(
&
sales
)
// 2-1、检查是否为线
下
销售
is_o
ffline_sales
:=
IsOff
lineSales
(
sales
.
Sale_Id
)
// 2-1、检查是否为线
上
销售
is_o
nline_sales
:=
IsOn
lineSales
(
sales
.
Sale_Id
)
if
is_offline_sales
{
// 属于线下
销售,则跳出本次循环
if
!
is_online_sales
{
// 若不属于线上
销售,则跳出本次循环
dao
.
GetDb
()
.
Exec
(
"update lie_salesman set sys_limit = ? where user_id = ?"
,
-
1
,
sales
.
User_Id
)
continue
}
...
...
@@ -67,8 +67,8 @@ func UpdateLimitFollowTime() {
}
}
// 检查是否属于线
下
销售
func
IsO
ff
lineSales
(
sale_id
int
)
bool
{
// 检查是否属于线
上
销售
func
IsO
n
lineSales
(
sale_id
int
)
bool
{
var
user_info
UserInfo
err
:=
dao
.
GetCmsDb
()
.
Get
(
&
user_info
,
"select userId,department_id,position_id from user_info where userId = ?"
,
sale_id
)
...
...
@@ -77,9 +77,9 @@ func IsOfflineSales(sale_id int) bool {
return
false
}
o
ffline_sales_department_ids
:=
GetOff
lineSaleDepartment
()
o
nline_sales_department_ids
:=
GetOn
lineSaleDepartment
()
_
,
ok
:=
SliceFind
(
o
ff
line_sales_department_ids
,
user_info
.
DepartmentId
)
_
,
ok
:=
SliceFind
(
o
n
line_sales_department_ids
,
user_info
.
DepartmentId
)
return
ok
}
...
...
@@ -94,19 +94,19 @@ func SliceFind(slice []int, val int) (int, bool) {
return
-
1
,
false
}
// 获取线
下销售所有部门 (线下销售部 40
)
func
GetO
ff
lineSaleDepartment
()
[]
int
{
var
o
ff
line_sales_department_ids
[]
int
o
ffline_sales_department_ids
=
append
(
offline_sales_department_ids
,
40
)
// 获取线
上销售所有部门 (线上销售部 33
)
func
GetO
n
lineSaleDepartment
()
[]
int
{
var
o
n
line_sales_department_ids
[]
int
o
nline_sales_department_ids
=
append
(
online_sales_department_ids
,
33
)
var
user_department
[]
*
UserDepartment
dao
.
GetCmsDb
()
.
Select
(
&
user_department
,
"select department_id,department_name,parent_id from user_department where parent_id =
40
"
)
dao
.
GetCmsDb
()
.
Select
(
&
user_department
,
"select department_id,department_name,parent_id from user_department where parent_id =
33
"
)
for
_
,
v
:=
range
user_department
{
o
ffline_sales_department_ids
=
append
(
off
line_sales_department_ids
,
v
.
DepartmentId
)
o
nline_sales_department_ids
=
append
(
on
line_sales_department_ids
,
v
.
DepartmentId
)
}
return
o
ff
line_sales_department_ids
return
o
n
line_sales_department_ids
}
// 计算跟进时间
...
...
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