|
@@ -99,28 +99,28 @@ class ViolationProduct extends Controller
|
|
|
//多选第一责任人
|
|
//多选第一责任人
|
|
|
if ($first_responsible_person && is_string($first_responsible_person)) {
|
|
if ($first_responsible_person && is_string($first_responsible_person)) {
|
|
|
$first_responsible_person = explode(',', $first_responsible_person);
|
|
$first_responsible_person = explode(',', $first_responsible_person);
|
|
|
- $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $first_responsible_person)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
|
|
|
|
+ $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $first_responsible_person)->distinct('violation_product_logid')->select('violation_product_logid');
|
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
- $query1->select('lowprice_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
|
|
|
|
+ $query1->select('violation_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
//多选责任人
|
|
//多选责任人
|
|
|
if ($responsible_person && is_string($responsible_person)) {
|
|
if ($responsible_person && is_string($responsible_person)) {
|
|
|
$responsible_person = explode(',', $responsible_person);
|
|
$responsible_person = explode(',', $responsible_person);
|
|
|
- $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $responsible_person)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
|
|
|
|
+ $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $responsible_person)->distinct('violation_product_logid')->select('violation_product_logid');
|
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
- $query1->select('lowprice_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
|
|
|
|
+ $query1->select('violation_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
//多选溯源责任人
|
|
//多选溯源责任人
|
|
|
if ($source_responsible_person && is_string($source_responsible_person)) {
|
|
if ($source_responsible_person && is_string($source_responsible_person)) {
|
|
|
$source_responsible_person = explode(',', $source_responsible_person);
|
|
$source_responsible_person = explode(',', $source_responsible_person);
|
|
|
- $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $source_responsible_person)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
|
|
|
|
+ $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $source_responsible_person)->distinct('violation_product_logid')->select('violation_product_logid');
|
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
- $query1->select('lowprice_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
|
|
|
|
+ $query1->select('violation_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- $result = $ViolationProductModel->query()
|
|
|
|
|
|
|
+ $result = $ViolationProductModel
|
|
|
->where($map)
|
|
->where($map)
|
|
|
->orderByDesc('id')
|
|
->orderByDesc('id')
|
|
|
->paginate($limit)->toarray();
|
|
->paginate($limit)->toarray();
|