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
09072b5f
authored
Apr 27, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
68df0fa7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
09072b5f
...
...
@@ -110,6 +110,7 @@ class SupplierFilter
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$userId
);
$adminUserService
=
new
AdminUserService
();
$subordinateCodeIds
=
$adminUserService
->
getCodeIdsByUserIds
(
$subordinateUserIds
);
$subordinateCodeIds
=
$subordinateCodeIds
->
toArray
();
//因为可以查看自己部下相关的采购员,开发员的供应商,所以要构建复杂likeIn语句需要的数据
//注意下面三个条件最外层要用()包围起来,要不然mysql数据会有问题,具体自己查询mysql的and和or的语法注意事项
$likeSqlRaw
=
implode
(
'|'
,
$subordinateCodeIds
);
...
...
@@ -118,6 +119,7 @@ class SupplierFilter
$inCodeIdSql
=
"("
.
$inCodeIdSql
.
")"
;
$inUserIdSql
=
"("
.
$inUserIdSql
.
")"
;
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or purchase_uid in
$inCodeIdSql
or channel_uid REGEXP '
$likeSqlRaw
') "
));
}
else
{
//剩下的就只是看自己相关的
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
or purchase_uid =
$codeId
or channel_uid like '%${codeId}%') "
));
...
...
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