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
160b215c
authored
Jun 04, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复采购员显示问题
parent
efe5920b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletions
app/Http/Transformers/SupplierTransformer.php
app/Model/IntracodeModel.php
app/Http/Transformers/SupplierTransformer.php
View file @
160b215c
...
...
@@ -66,7 +66,7 @@ class SupplierTransformer
{
$canViewAllChannelUser
=
checkPerm
(
'ViewAllChannelUser'
);
$intracodeModel
=
new
IntracodeModel
();
$userCodes
=
$intracodeModel
->
getSampleEncode
();
$userCodes
=
$intracodeModel
->
get
All
SampleEncode
();
$data
=
[];
$channelUidList
=
explode
(
','
,
$channelUid
);
$channelUidList
=
array_unique
(
$channelUidList
);
...
...
app/Model/IntracodeModel.php
View file @
160b215c
...
...
@@ -11,6 +11,7 @@ class IntracodeModel extends Model
protected
$table
=
'lie_intracode'
;
protected
$primaryKey
=
'code_id'
;
//不包含离职
public
function
getEncode
()
{
$redis
=
new
RedisModel
();
...
...
@@ -33,6 +34,27 @@ class IntracodeModel extends Model
return
$codeList
;
}
//包含离职的
public
function
getAllEncode
()
{
$redis
=
new
RedisModel
();
$codeList
=
json_decode
(
$redis
->
get
(
'EncodedList_supplier'
),
true
);
if
(
!
$codeList
)
{
$codeList
=
$this
->
where
(
'admin_id'
,
'>'
,
0
)
->
join
(
'user_info'
,
'lie_intracode.admin_id'
,
'='
,
'user_info.userId'
)
->
select
(
'code_id'
,
'admin_id'
,
'name'
,
'email'
)
->
get
();
if
(
$codeList
)
{
$codeList
=
$codeList
->
toArray
();
foreach
(
$codeList
as
$k
=>
&
$v
)
{
if
(
empty
(
$v
[
'name'
]))
{
$v
[
'name'
]
=
$v
[
'email'
];
}
}
$redis
->
set
(
'EncodedList_supplier'
,
json_encode
(
$codeList
));
$redis
->
expire
(
'EncodedList_supplier'
,
60
*
10
);
//缓存10分钟
}
}
return
$codeList
;
}
//获取简单的内部用户数据
public
function
getSampleEncode
()
...
...
@@ -45,6 +67,17 @@ class IntracodeModel extends Model
return
$result
;
}
//获取简单的内部用户数据(包含离职)
public
function
getAllSampleEncode
()
{
$codeList
=
$this
->
getAllEncode
();
$result
=
[];
foreach
(
$codeList
as
$code
)
{
$result
[
$code
[
'code_id'
]]
=
$code
[
'name'
]
.
'('
.
$code
[
'code_id'
]
.
')'
;
}
return
$result
;
}
//获取采购员和对应的编码
public
function
getChannelUsersEncode
()
{
...
...
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