Commit ba0b83c0 by 杨树贤

再次优化

parent 4c23d36f
...@@ -384,14 +384,14 @@ class SupplierFilter ...@@ -384,14 +384,14 @@ class SupplierFilter
$query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_expired_in_days', '!=', 0)->where('uploaded_sku', 1); $query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_expired_in_days', '!=', 0)->where('uploaded_sku', 1);
break; break;
case "no_quality_assurance_agreement_all": case "no_quality_assurance_agreement_all":
$query->whereDoesntHave('attachment', function ($query) { $query->whereNotIn('supplier_id', function ($query) {
$query->where('field_name', 'quality_assurance_agreement'); $query->select('supplier_id')->from(with(new SupplierAttachmentsModel())->getTable())->where('field_name','quality_assurance_agreement');
})->where('uploaded_sku', 1); })->where('uploaded_sku', 1);
break; break;
case "no_cooperation_agreement": case "no_cooperation_agreement":
$query->whereNotIn('supplier_id', function ($query) { $query->whereNotIn('supplier_id', function ($query) {
$query->select('supplier_id')->from(with(new SupplierAttachmentsModel())->getTable())->where('field_name','cooperation_agreement'); $query->select('supplier_id')->from(with(new SupplierAttachmentsModel())->getTable())->where('field_name','cooperation_agreement');
}); })->where('uploaded_sku', 1);
break; break;
} }
return $query; return $query;
......
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