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
24015c64
authored
May 10, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
查询语句
parent
d48779b2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
5 deletions
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
24015c64
...
...
@@ -259,16 +259,12 @@ class SupplierFilter
break
;
//附件里面缺少品质协议的
case
"no_quality_assurance_agreement"
:
// $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_attachments.field_name,lie_supplier_attachments.supplier_id as supplier_attachments_supplier_id'
)
->
where
(
function
(
$q
)
{
$q
->
where
(
'supplier_attachments.field_name'
,
'!='
,
'quality_assurance_agreement'
)
->
orWhereNull
(
'supplier_attachments.supplier_id'
);
$q
->
whereRaw
(
"(SELECT count(1) FROM lie_supplier_attachments WHERE `lie_supplier_attachments`.`supplier_id` = `lie_supplier_channel`.`supplier_id` AND `lie_supplier_attachments`.field_name = 'quality_assurance_agreement') = 0"
);
});
// $query->whereNotIn('status',
// [SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK]);
...
...
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