Commit b926420a by mushishixian

fix

parent cd1991e2
...@@ -97,6 +97,10 @@ class SupplierFilter ...@@ -97,6 +97,10 @@ class SupplierFilter
} }
//默认过滤带有-1字符串的供应商名称的数据 //默认过滤带有-1字符串的供应商名称的数据
$query->whereRaw('supplier_name NOT LIKE "%-1"'); $query->whereRaw('supplier_name NOT LIKE "%-1"');
// if ($map['source_type'] == 'all') {
// //还要看到所有黑名单
// $query->orWhere('status', SupplierChannelModel::STATUS_BLOCK);
// }
return $query; return $query;
} }
...@@ -135,28 +139,30 @@ class SupplierFilter ...@@ -135,28 +139,30 @@ class SupplierFilter
$inUserIdSql = implode(',', $subordinateUserIds); $inUserIdSql = implode(',', $subordinateUserIds);
$inCodeIdSql = "(" . $inCodeIdSql . ")"; $inCodeIdSql = "(" . $inCodeIdSql . ")";
$inUserIdSql = "(" . $inUserIdSql . ")"; $inUserIdSql = "(" . $inUserIdSql . ")";
//为啥下面所有获取数据源约束的语句都要加上status=-3
//是因为无论什么角色,都可以看到黑名单
if ($subordinateCodeIds) { if ($subordinateCodeIds) {
if ($canViewFakeSupplier) { if ($canViewFakeSupplier) {
$query->whereRaw(DB::raw("(create_uid in $inUserIdSql or purchase_uid in $inCodeIdSql $query->whereRaw(DB::raw("(create_uid in $inUserIdSql or purchase_uid in $inCodeIdSql
or channel_uid REGEXP '$likeSqlRaw' or is_type = 1) ")); or channel_uid REGEXP '$likeSqlRaw' or is_type = 1 or status = -3) "));
} else { } else {
$query->whereRaw(DB::raw("(create_uid in $inUserIdSql or purchase_uid in $inCodeIdSql $query->whereRaw(DB::raw("(create_uid in $inUserIdSql or purchase_uid in $inCodeIdSql
or channel_uid REGEXP '$likeSqlRaw') ")); or channel_uid REGEXP '$likeSqlRaw' or status = -3) "));
} }
} else { } else {
if ($canViewFakeSupplier) { if ($canViewFakeSupplier) {
$query->whereRaw(DB::raw("(create_uid in $inUserIdSql or is_type = 1)")); $query->whereRaw(DB::raw("(create_uid in $inUserIdSql or is_type = 1 or status = -3)"));
} else { } else {
$query->whereRaw(DB::raw("(create_uid in $inUserIdSql)")); $query->whereRaw(DB::raw("(create_uid in $inUserIdSql or status = -3)"));
} }
} }
} else { } else {
if ($codeId) { if ($codeId) {
//剩下的就只是看自己相关的 //剩下的就只是看自己相关的
$query->whereRaw(DB::raw("(create_uid = $userId or purchase_uid = $codeId or channel_uid like '%${codeId}%') ")); $query->whereRaw(DB::raw("(create_uid = $userId or purchase_uid = $codeId or channel_uid like '%${codeId}%' or status = -3) "));
} else { } else {
$query->whereRaw(DB::raw("(create_uid = $userId)")); $query->whereRaw(DB::raw("(create_uid = $userId or status = -3)"));
} }
} }
...@@ -165,8 +171,6 @@ class SupplierFilter ...@@ -165,8 +171,6 @@ class SupplierFilter
//先判断获取类型 //先判断获取类型
switch ($sourceType) { switch ($sourceType) {
case "all": case "all":
//还要看到所有黑名单
// $query->orWhere('status', SupplierChannelModel::STATUS_BLOCK);
break; break;
case "pending": case "pending":
//待复审供应商 //待复审供应商
...@@ -233,7 +237,7 @@ class SupplierFilter ...@@ -233,7 +237,7 @@ class SupplierFilter
break; break;
case "block": case "block":
$query->where('status', SupplierChannelModel::STATUS_BLOCK); $query->where('status', SupplierChannelModel::STATUS_BLOCK);
// $query->orWhere('status', SupplierChannelModel::STATUS_BLOCK); $query->orWhere('status', SupplierChannelModel::STATUS_BLOCK);
break; break;
case "has_supplier_tag": case "has_supplier_tag":
$query->where(function ($q) { $query->where(function ($q) {
......
...@@ -529,7 +529,7 @@ ...@@ -529,7 +529,7 @@
form.on('submit(load)', function (data) { form.on('submit(load)', function (data) {
//罗盘选项会跳回全部 //罗盘选项会跳回全部
clearTypeFilter(); clearTypeFilter();
$('#all').attr('class', 'status_filter layui-badge layui-bg-green'); $('#total').attr('class', 'status_filter layui-badge layui-bg-green');
whereCondition.source_type = 'all'; whereCondition.source_type = 'all';
initCondition.source_type = whereCondition.source_type; initCondition.source_type = whereCondition.source_type;
whereCondition = $.extend(false, initCondition, data.field); whereCondition = $.extend(false, initCondition, data.field);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="split-item" id="s1"> <div class="split-item" id="s1">
<div class="layui-row"> <div class="layui-row">
{{-- <a class="main_filter layui-badge layui-bg-green" id="all">全部({{$statistics['total']}})</a>--}} {{-- <a class="main_filter layui-badge layui-bg-green" id="all">全部({{$statistics['total']}})</a>--}}
<a class="main_filter layui-badge layui-bg-green" id="all">全部(999+)</a> <a class="main_filter layui-badge layui-bg-green" id="total"></a>
</div> </div>
</div> </div>
<div class="split-item" id="s2" style="text-align: center"> <div class="split-item" id="s2" style="text-align: center">
......
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