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
b926420a
authored
Aug 11, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
cd1991e2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
app/Http/Controllers/Filter/SupplierFilter.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/supplier/SupplierListCommon.blade.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
b926420a
...
...
@@ -97,6 +97,10 @@ class SupplierFilter
}
//默认过滤带有-1字符串的供应商名称的数据
$query
->
whereRaw
(
'supplier_name NOT LIKE "%-1"'
);
// if ($map['source_type'] == 'all') {
// //还要看到所有黑名单
// $query->orWhere('status', SupplierChannelModel::STATUS_BLOCK);
// }
return
$query
;
}
...
...
@@ -135,28 +139,30 @@ class SupplierFilter
$inUserIdSql
=
implode
(
','
,
$subordinateUserIds
);
$inCodeIdSql
=
"("
.
$inCodeIdSql
.
")"
;
$inUserIdSql
=
"("
.
$inUserIdSql
.
")"
;
//为啥下面所有获取数据源约束的语句都要加上status=-3
//是因为无论什么角色,都可以看到黑名单
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 channel_uid REGEXP '
$likeSqlRaw
' or is_type = 1
or status = -3
) "
));
}
else
{
$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
{
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
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
)"
));
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or status = -3
)"
));
}
}
}
else
{
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
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
)"
));
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
or status = -3
)"
));
}
}
...
...
@@ -165,8 +171,6 @@ class SupplierFilter
//先判断获取类型
switch
(
$sourceType
)
{
case
"all"
:
//还要看到所有黑名单
// $query->orWhere('status', SupplierChannelModel::STATUS_BLOCK);
break
;
case
"pending"
:
//待复审供应商
...
...
@@ -233,7 +237,7 @@ class SupplierFilter
break
;
case
"block"
:
$query
->
where
(
'status'
,
SupplierChannelModel
::
STATUS_BLOCK
);
//
$query->orWhere('status', SupplierChannelModel::STATUS_BLOCK);
$query
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_BLOCK
);
break
;
case
"has_supplier_tag"
:
$query
->
where
(
function
(
$q
)
{
...
...
resources/views/script/SupplierListScript.blade.php
View file @
b926420a
...
...
@@ -529,7 +529,7 @@
form
.
on
(
'submit(load)'
,
function
(
data
)
{
//罗盘选项会跳回全部
clearTypeFilter
();
$
(
'#
al
l'
).
attr
(
'class'
,
'status_filter layui-badge layui-bg-green'
);
$
(
'#
tota
l'
).
attr
(
'class'
,
'status_filter layui-badge layui-bg-green'
);
whereCondition
.
source_type
=
'all'
;
initCondition
.
source_type
=
whereCondition
.
source_type
;
whereCondition
=
$
.
extend
(
false
,
initCondition
,
data
.
field
);
...
...
resources/views/web/supplier/SupplierListCommon.blade.php
View file @
b926420a
...
...
@@ -14,7 +14,7 @@
<div
class=
"split-item"
id=
"s1"
>
<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"
>
全部(999+)
</a>
<a
class=
"main_filter layui-badge layui-bg-green"
id=
"
total"
>
</a>
</div>
</div>
<div
class=
"split-item"
id=
"s2"
style=
"text-align: center"
>
...
...
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