Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
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
66dbed48
authored
Aug 18, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
43dbd620
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
app/Model/IntracodeModel.php
app/Model/IntracodeModel.php
View file @
66dbed48
...
...
@@ -86,7 +86,7 @@ class IntracodeModel extends Model
}
//获取采购员和对应的编码
public
function
getChannelUsersEncode
()
public
function
getChannelUsersEncode
(
$includeResign
=
true
)
{
$redis
=
new
RedisModel
();
$result
=
json_decode
(
$redis
->
get
(
'department_user_encode_list'
),
true
);
...
...
@@ -102,13 +102,13 @@ class IntracodeModel extends Model
$userChannel
=
$departmentService
->
getUserByDepartmentId
(
8
);
$users
=
array_merge
(
array_merge
(
$usersMarket
,
$usersOperation
),
$userChannel
);
$userIds
=
array_column
(
$users
,
'userId'
);
$users
=
$this
->
getEncodeByUserIds
(
$userIds
);
$users
=
$this
->
getEncodeByUserIds
(
$userIds
,
$includeResign
);
$result
=
[];
foreach
(
$users
as
$code
)
{
$result
[
$code
[
'code_id'
]]
=
$code
[
'name'
]
.
'('
.
$code
[
'code_id'
]
.
')'
;
}
$redis
->
set
(
'department_user_encode_list'
,
json_encode
(
$result
));
$redis
->
expire
(
'department_user_encode_list'
,
60
0
);
$redis
->
expire
(
'department_user_encode_list'
,
1
0
);
return
$result
;
}
...
...
@@ -123,11 +123,12 @@ class IntracodeModel extends Model
return
$result
;
}
public
function
getEncodeByUserIds
(
$userIds
=
[])
public
function
getEncodeByUserIds
(
$userIds
=
[]
,
$includeResign
=
true
)
{
$
code
=
$this
->
where
(
'admin_id'
,
'>'
,
0
)
->
join
(
'user_info'
,
'lie_intracode.admin_id'
,
'='
,
'user_info.userId'
)
$
query
=
$this
->
where
(
'admin_id'
,
'>'
,
0
)
->
join
(
'user_info'
,
'lie_intracode.admin_id'
,
'='
,
'user_info.userId'
)
->
whereIn
(
'user_info.userId'
,
$userIds
)
->
select
(
'code_id'
,
'admin_id'
,
'name'
,
'email'
,
'mobile'
)
->
get
();
->
select
(
'code_id'
,
'admin_id'
,
'name'
,
'email'
,
'mobile'
);
$code
=
$includeResign
?
$query
->
get
()
:
$query
->
where
(
'user_info.status'
,
'!='
,
4
)
->
get
();
if
(
$code
)
{
$code
=
$code
->
toArray
();
}
...
...
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