Просмотр исходного кода

[智价云] 合并单元格修复

tangyuanwang 1 день назад
Родитель
Сommit
bb40002959

+ 4 - 4
app/Jobs/Manager/Other/ExportLowPriceGoodsJobs.php

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

+ 4 - 4
app/Jobs/Manager/Other/ExportViolationProductJobs.php

@@ -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文件