Commit d1a3e94a by 杨树贤

黑名单查看权限

parent 8eafb160
......@@ -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)"));
}
}
......
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