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
d48779b2
authored
May 10, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
查询语句
parent
27e2d142
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
d48779b2
...
...
@@ -107,8 +107,14 @@ class SupplierFilter
}
//默认过滤带有-1字符串的供应商名称的数据
$query
->
whereRaw
(
'supplier_name NOT LIKE "%-1"'
);
if
(
config
(
'website.domain'
)
==
'liexin.net'
&&
!
in_array
(
request
()
->
user
->
userId
,
[
1611
,
1499
,
1354
,
1613
]))
{
$query
->
where
(
'supplier_id'
,
'>'
,
12211
);
if
(
config
(
'website.domain'
)
==
'liexin.net'
&&
!
in_array
(
request
()
->
user
->
userId
,
[
1611
,
1499
,
1354
,
1613
,
1000
]))
{
$query
->
where
(
'supplier_channel.supplier_id'
,
'>'
,
12211
);
}
return
$query
;
}
...
...
@@ -253,16 +259,19 @@ class SupplierFilter
break
;
//附件里面缺少品质协议的
case
"no_quality_assurance_agreement"
:
$query
->
leftjoin
(
'supplier_attachment'
,
'supplier_channel.supplier_id'
,
'='
,
'supplier_attachment.supplier_id'
)
// $query->whereHas('attachment', function ($q) {
// $q->where('field_name', '!=', 'quality_assurance_agreement');
// });
$query
->
leftjoin
(
'supplier_attachments'
,
'supplier_channel.supplier_id'
,
'='
,
'supplier_attachments.supplier_id'
)
->
selectRaw
(
'lie_supplier_channel.*,
lie_supplier_attachment
.quality_assurance_agreement,lie_supplier_attachment.supplier_id as supplier_attachment
_supplier_id'
)
lie_supplier_attachment
s.field_name,lie_supplier_attachments.supplier_id as supplier_attachments
_supplier_id'
)
->
where
(
function
(
$q
)
{
$q
->
where
(
'supplier_attachment
.quality_assurance_agreement'
,
'
'
)
->
orWhereNull
(
'supplier_attachment.supplier_id'
);
$q
->
where
(
'supplier_attachment
s.field_name'
,
'!='
,
'quality_assurance_agreement
'
)
->
orWhereNull
(
'supplier_attachment
s
.supplier_id'
);
});
$query
->
whereNotIn
(
'status'
,
[
SupplierChannelModel
::
STATUS_DISABLE
,
SupplierChannelModel
::
STATUS_BLOCK
]);
//
$query->whereNotIn('status',
//
[SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK]);
//而且还是现货商类型的供应商
$query
->
where
(
'supplier_group'
,
2
);
break
;
...
...
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