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
87e74ab2
authored
Sep 02, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
查看账号权限修改基础逻辑
parent
e78f1734
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
app/Http/Controllers/Filter/SupplierAccountFilter.php
app/Http/Controllers/Filter/SupplierAccountFilter.php
View file @
87e74ab2
...
...
@@ -18,7 +18,7 @@ class SupplierAccountFilter
$map
=
$request
->
all
();
$model
=
new
SupplierAccountModel
();
$query
=
$model
->
with
(
'supplier'
)
->
where
(
'parent_id'
,
0
)
->
orderBy
(
'id'
,
'desc'
);
$codeId
=
$request
->
user
->
codeId
;
if
(
!
checkPerm
(
'ViewAllSupplierAccount'
))
{
if
(
checkPerm
(
'ViewSubSupplierAccount'
))
{
$departmentService
=
new
DepartmentService
();
...
...
@@ -27,11 +27,12 @@ class SupplierAccountFilter
$adminUserService
=
new
AdminUserService
();
$subordinateCodeIds
=
$adminUserService
->
getCodeIdsByUserIds
(
$subordinateUserIds
);
$subordinateCodeIds
=
$subordinateCodeIds
->
toArray
();
$supplierIds
=
SupplierChannelModel
::
whereIn
(
'yunxin_channel_uid'
,
$subordinateCodeIds
)
->
pluck
(
'supplier_id'
)
->
toArray
();
$likeSqlRaw
=
implode
(
'|'
,
$subordinateCodeIds
);
$supplierIds
=
SupplierChannelModel
::
whereRaw
(
DB
::
raw
(
"(channel_uid REGEXP '
$likeSqlRaw
')"
))
->
pluck
(
'supplier_id'
)
->
toArray
();
$query
->
whereIn
(
'supplier_id'
,
$supplierIds
);
}
else
{
//否则只能查看自己的
$supplierIds
=
SupplierChannelModel
::
where
(
'yunxin_channel_uid'
,
$request
->
user
->
codeId
)
->
pluck
(
'supplier_id'
)
->
toArray
();
$supplierIds
=
SupplierChannelModel
::
where
Raw
(
DB
::
raw
(
"(yunxin_channel_uid REGEXP '
$codeId
')"
)
)
->
pluck
(
'supplier_id'
)
->
toArray
();
$query
->
whereIn
(
'supplier_id'
,
$supplierIds
);
}
}
...
...
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