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
0ab3c241
authored
May 25, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
待确认
parent
d98013c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
0ab3c241
...
...
@@ -305,15 +305,24 @@ class SupplierFilter
$canViewFakeSupplier
=
checkPerm
(
'ViewFakeSupplier'
);
$canViewBlockSupplier
=
checkPerm
(
'ViewBlockSupplier'
);
$canViewDisableSupplier
=
checkPerm
(
'ViewDisableSupplier'
);
$canViewConfirmSupplier
=
checkPerm
(
'ViewConfirmSupplier'
);
// 构建复合查询条件:基础条件 OR 特殊状态
$query
->
where
(
function
(
$mainQuery
)
use
(
$canViewFakeSupplier
,
$canViewBlockSupplier
,
$canViewDisableSupplier
,
$userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
$query
->
where
(
function
(
$mainQuery
)
use
(
$canViewFakeSupplier
,
$canViewBlockSupplier
,
$canViewDisableSupplier
,
$
canViewConfirmSupplier
,
$
userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
// 主要条件组:基础业务条件
$mainQuery
->
where
(
function
(
$baseQuery
)
use
(
$canViewFakeSupplier
,
$userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
$mainQuery
->
where
(
function
(
$baseQuery
)
use
(
$canViewFakeSupplier
,
$
canViewConfirmSupplier
,
$
userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
// 基础类型限制
if
(
!
$canViewFakeSupplier
)
{
$baseQuery
->
where
(
'is_type'
,
0
);
}
// 如果没有查看待确认供应商权限,过滤掉待确认和CRM转移供应商不通过状态的供应商
if
(
!
$canViewConfirmSupplier
)
{
$baseQuery
->
whereNotIn
(
'status'
,
[
SupplierChannelModel
::
STATUS_CONFIRM
,
SupplierChannelModel
::
STATUS_CRM_REJECTED
]);
}
// 权限相关的条件
if
(
!
$canViewAllSupplier
)
{
if
(
$canViewSubordinateSupplier
)
{
...
...
@@ -352,6 +361,10 @@ class SupplierFilter
if
(
$canViewDisableSupplier
&&
!
checkPerm
(
'ViewAllSupplier'
))
{
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_DISABLE
);
}
if
(
$canViewConfirmSupplier
&&
!
checkPerm
(
'ViewAllSupplier'
))
{
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_CONFIRM
);
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_CRM_REJECTED
);
}
// //只有原厂、代理商需要走权限,其他性质的随便看
// if (!checkPerm('ViewAllSupplier')) {
...
...
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