Commit 0ab3c241 by 杨树贤

待确认

parent d98013c6
Showing with 15 additions and 2 deletions
......@@ -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')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment