|
|
@@ -173,7 +173,7 @@ class ExportViolationProductJobs implements ShouldQueue
|
|
|
//多选第一责任人
|
|
|
if ($first_responsible_person && is_string($first_responsible_person)) {
|
|
|
$first_responsible_person = explode(',', $first_responsible_person);
|
|
|
- $subQuery = $ViolationProductModel->whereIn('employee_id', $first_responsible_person)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
+ $subQuery = $ViolationProductModel->whereIn('employee_id', $first_responsible_person)->where('duty_type',1)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
$query1->select('lowprice_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
});
|
|
|
@@ -181,7 +181,7 @@ class ExportViolationProductJobs implements ShouldQueue
|
|
|
//多选责任人
|
|
|
if ($responsible_person && is_string($responsible_person)) {
|
|
|
$responsible_person = explode(',', $responsible_person);
|
|
|
- $subQuery = $ViolationProductModel->whereIn('employee_id', $responsible_person)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
+ $subQuery = $ViolationProductModel->whereIn('employee_id', $responsible_person)->where('duty_type',2)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
$query1->select('lowprice_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
});
|
|
|
@@ -189,7 +189,7 @@ class ExportViolationProductJobs implements ShouldQueue
|
|
|
//多选溯源责任人
|
|
|
if ($source_responsible_person && is_string($source_responsible_person)) {
|
|
|
$source_responsible_person = explode(',', $source_responsible_person);
|
|
|
- $subQuery = $ViolationProductModel->whereIn('employee_id', $source_responsible_person)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
+ $subQuery = $ViolationProductModel->whereIn('employee_id', $source_responsible_person)->where('duty_type',3)->distinct('lowprice_product_logid')->select('lowprice_product_logid');
|
|
|
$ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
$query1->select('lowprice_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
});
|
|
|
@@ -414,7 +414,7 @@ class ExportViolationProductJobs implements ShouldQueue
|
|
|
$sheet->setCellValue('X' . $row, $item['shipment_city_name']);
|
|
|
$row++;
|
|
|
}
|
|
|
- foreach (range('A', 'Z') as $column) {
|
|
|
+ foreach (range('A', 'X') as $column) {
|
|
|
$sheet->getColumnDimension($column)->setAutoSize(true);
|
|
|
}
|
|
|
// 创建Excel文件
|