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
d1a3e94a
authored
Nov 16, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
黑名单查看权限
parent
8eafb160
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
d1a3e94a
...
...
@@ -228,30 +228,28 @@ class SupplierFilter
$inUserIdSql
=
implode
(
','
,
$subordinateUserIds
);
$inCodeIdSql
=
"("
.
$inCodeIdSql
.
")"
;
$inUserIdSql
=
"("
.
$inUserIdSql
.
")"
;
//为啥下面所有获取数据源约束的语句都要加上status=-3 或者 -2
//是因为无论什么角色,都可以看到黑名单和禁用供应商
if
(
$subordinateCodeIds
)
{
if
(
$canViewFakeSupplier
)
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or purchase_uid in
$inCodeIdSql
or channel_uid REGEXP '
$likeSqlRaw
' or is_type = 1
or (status = -3 or status = -2)
) "
));
or channel_uid REGEXP '
$likeSqlRaw
' or is_type = 1) "
));
}
else
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or purchase_uid in
$inCodeIdSql
or channel_uid REGEXP '
$likeSqlRaw
'
or (status = -3 or status = -2)
) "
));
or channel_uid REGEXP '
$likeSqlRaw
') "
));
}
}
else
{
if
(
$canViewFakeSupplier
)
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or is_type = 1
or status = -3
)"
));
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or is_type = 1)"
));
}
else
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or status = -3
)"
));
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
)"
));
}
}
}
else
{
if
(
$codeId
)
{
//剩下的就只是看自己相关的
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
or purchase_uid =
$codeId
or channel_uid like '%${codeId}%'
or status = -3
) "
));
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
or purchase_uid =
$codeId
or channel_uid like '%${codeId}%') "
));
}
else
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
or status = -3
)"
));
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
)"
));
}
}
...
...
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