Sfoglia il codice sorgente

[智价云] 增加清洗产品数据导出分类显示功能

tangyuanwang 1 giorno fa
parent
commit
be45659f34

+ 35 - 31
app/Http/Controllers/Manager/Process/LowPriceGoods.php

@@ -176,12 +176,14 @@ class LowPriceGoods extends Controller
         $processing_status = request('processing_status', '');
         $product_specs = request('product_specs', '');
         $online_posting_cunt = request('online_posting_cunt', '');
+        $category_name = request('category_name', '');
         // 时间条件
         if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
         if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
 
         //多选平台查询
         if ($platform && is_string($platform)) {
@@ -330,7 +332,7 @@ class LowPriceGoods extends Controller
         $sheet = $spreadsheet->getActiveSheet();
 
         //合并单元格
-        $sheet->mergeCells('A1:R1');
+        $sheet->mergeCells('A1:S1');
         $sheet->setCellValue('A1', '低价挂网商品导出(导出时间:' . date('Y-m-d H:i:s', time()) . ')'); // 设置合并后的单元格内容
         // 获取合并后的单元格样式对象
         $style = $sheet->getStyle('A1');
@@ -342,21 +344,22 @@ class LowPriceGoods extends Controller
         $sheet->setCellValue('A2', '第一责任人');
         $sheet->setCellValue('B2', '责任人');
         $sheet->setCellValue('C2', '平台');
-        $sheet->setCellValue('D2', '商品名称');
-        $sheet->setCellValue('E2', '商品规格');
-        $sheet->setCellValue('F2', '指导价');
-        $sheet->setCellValue('G2', '挂网价格');
-        $sheet->setCellValue('H2', '挂网次数');
-        $sheet->setCellValue('I2', '链接地址');
-        $sheet->setCellValue('J2', '店铺名称');
-        $sheet->setCellValue('K2', '公司名称');
-        $sheet->setCellValue('L2', '信用代码');
-        $sheet->setCellValue('M2', '省份');
-        $sheet->setCellValue('N2', '城市');
-        $sheet->setCellValue('O2', '溯源责任人');
-        $sheet->setCellValue('P2', '处理状态');
-        $sheet->setCellValue('Q2', '任务状态');
-        $sheet->setCellValue('R2', '记录时间');
+        $sheet->setCellValue('D2', '商品分类');
+        $sheet->setCellValue('E2', '商品名称');
+        $sheet->setCellValue('F2', '商品规格');
+        $sheet->setCellValue('G2', '指导价');
+        $sheet->setCellValue('H2', '挂网价格');
+        $sheet->setCellValue('I2', '挂网次数');
+        $sheet->setCellValue('J2', '链接地址');
+        $sheet->setCellValue('K2', '店铺名称');
+        $sheet->setCellValue('L2', '公司名称');
+        $sheet->setCellValue('M2', '信用代码');
+        $sheet->setCellValue('N2', '省份');
+        $sheet->setCellValue('O2', '城市');
+        $sheet->setCellValue('P2', '溯源责任人');
+        $sheet->setCellValue('Q2', '处理状态');
+        $sheet->setCellValue('R2', '任务状态');
+        $sheet->setCellValue('S2', '记录时间');
 
         $platform_data = [
             '0' => '全部',
@@ -384,21 +387,22 @@ class LowPriceGoods extends Controller
             $sheet->setCellValue('A' . $row, $first_responsible_person_name);
             $sheet->setCellValue('B' . $row, $responsible_person_name);
             $sheet->setCellValue('C' . $row, isset($platform_data[$item['platform']]) ? $platform_data[$item['platform']] : '');
-            $sheet->setCellValue('D' . $row, $item['product_name']);
-            $sheet->setCellValue('E' . $row, $item['product_specs']);
-            $sheet->setCellValue('F' . $row, $item['suggested_price']);
-            $sheet->setCellValue('G' . $row, $item['online_posting_price']);
-            $sheet->setCellValue('H' . $row, $item['online_posting_cunt']);
-            $sheet->setCellValue('I' . $row, $item['link_url']);
-            $sheet->setCellValue('J' . $row, $item['store_name']);
-            $sheet->setCellValue('K' . $row, $item['company_name']);
-            $sheet->setCellValue('L' . $row, $item['social_credit_code']);
-            $sheet->setCellValue('M' . $row, $item['province_name']);
-            $sheet->setCellValue('N' . $row, $item['city_name']);
-            $sheet->setCellValue('O' . $row, $source_responsible_person_name);
-            $sheet->setCellValue('P' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
-            $sheet->setCellValue('Q' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
-            $sheet->setCellValue('R' . $row, date('Y-m-d H:i:s', $item['insert_time']));
+            $sheet->setCellValue('D' . $row, $item['category_name']);
+            $sheet->setCellValue('E' . $row, $item['product_name']);
+            $sheet->setCellValue('F' . $row, $item['product_specs']);
+            $sheet->setCellValue('G' . $row, $item['suggested_price']);
+            $sheet->setCellValue('H' . $row, $item['online_posting_price']);
+            $sheet->setCellValue('I' . $row, $item['online_posting_cunt']);
+            $sheet->setCellValue('J' . $row, $item['link_url']);
+            $sheet->setCellValue('K' . $row, $item['store_name']);
+            $sheet->setCellValue('L' . $row, $item['company_name']);
+            $sheet->setCellValue('M' . $row, $item['social_credit_code']);
+            $sheet->setCellValue('N' . $row, $item['province_name']);
+            $sheet->setCellValue('O' . $row, $item['city_name']);
+            $sheet->setCellValue('P' . $row, $source_responsible_person_name);
+            $sheet->setCellValue('Q' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
+            $sheet->setCellValue('R' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
+            $sheet->setCellValue('S' . $row, date('Y-m-d H:i:s', $item['insert_time']));
             $row++;
         }
         // 生成 Excel 文件

+ 31 - 27
app/Http/Controllers/Manager/Process/ViolationProduct.php

@@ -175,12 +175,14 @@ class ViolationProduct extends Controller
         $processing_status = request('processing_status', '');
         $product_specs = request('product_specs', '');
         $online_posting_cunt = request('online_posting_cunt', '');
+        $category_name = request('category_name', '');
         // 时间条件
         if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
         if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
 
         //多选平台查询
         if ($platform && is_string($platform)) {
@@ -329,7 +331,7 @@ class ViolationProduct extends Controller
         $sheet = $spreadsheet->getActiveSheet();
 
         //合并单元格
-        $sheet->mergeCells('A1:P1');
+        $sheet->mergeCells('A1:Q1');
         $sheet->setCellValue('A1', '违规挂网商品导出(导出时间:' . date('Y-m-d H:i:s', time()) . ')'); // 设置合并后的单元格内容
         // 获取合并后的单元格样式对象
         $style = $sheet->getStyle('A1');
@@ -341,19 +343,20 @@ class ViolationProduct extends Controller
         $sheet->setCellValue('A2', '第一责任人');
         $sheet->setCellValue('B2', '责任人');
         $sheet->setCellValue('C2', '平台');
-        $sheet->setCellValue('D2', '商品名称');
-        $sheet->setCellValue('E2', '商品规格');
-        $sheet->setCellValue('F2', '挂网次数');
-        $sheet->setCellValue('G2', '链接地址');
-        $sheet->setCellValue('H2', '店铺名称');
-        $sheet->setCellValue('I2', '公司名称');
-        $sheet->setCellValue('J2', '信用代码');
-        $sheet->setCellValue('K2', '省份');
-        $sheet->setCellValue('L2', '城市');
-        $sheet->setCellValue('M2', '溯源责任人');
-        $sheet->setCellValue('N2', '处理状态');
-        $sheet->setCellValue('O2', '任务状态');
-        $sheet->setCellValue('P2', '记录时间');
+        $sheet->setCellValue('D2', '商品分类');
+        $sheet->setCellValue('E2', '商品名称');
+        $sheet->setCellValue('F2', '商品规格');
+        $sheet->setCellValue('G2', '挂网次数');
+        $sheet->setCellValue('H2', '链接地址');
+        $sheet->setCellValue('I2', '店铺名称');
+        $sheet->setCellValue('J2', '公司名称');
+        $sheet->setCellValue('K2', '信用代码');
+        $sheet->setCellValue('L2', '省份');
+        $sheet->setCellValue('M2', '城市');
+        $sheet->setCellValue('N2', '溯源责任人');
+        $sheet->setCellValue('O2', '处理状态');
+        $sheet->setCellValue('P2', '任务状态');
+        $sheet->setCellValue('Q2', '记录时间');
 
         $platform_data = [
             '0' => '全部',
@@ -381,19 +384,20 @@ class ViolationProduct extends Controller
             $sheet->setCellValue('A' . $row, $first_responsible_person_name);
             $sheet->setCellValue('B' . $row, $responsible_person_name);
             $sheet->setCellValue('C' . $row, isset($platform_data[$item['platform']]) ? $platform_data[$item['platform']] : '');
-            $sheet->setCellValue('D' . $row, $item['product_name']);
-            $sheet->setCellValue('E' . $row, $item['product_specs']);
-            $sheet->setCellValue('F' . $row, $item['online_posting_cunt']);
-            $sheet->setCellValue('G' . $row, $item['link_url']);
-            $sheet->setCellValue('H' . $row, $item['store_name']);
-            $sheet->setCellValue('I' . $row, $item['company_name']);
-            $sheet->setCellValue('J' . $row, $item['social_credit_code']);
-            $sheet->setCellValue('K' . $row, $item['province_name']);
-            $sheet->setCellValue('L' . $row, $item['city_name']);
-            $sheet->setCellValue('M' . $row, $source_responsible_person_name);
-            $sheet->setCellValue('N' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
-            $sheet->setCellValue('O' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
-            $sheet->setCellValue('P' . $row, date('Y-m-d H:i:s', $item['insert_time']));
+            $sheet->setCellValue('D' . $row, $item['category_name']);
+            $sheet->setCellValue('E' . $row, $item['product_name']);
+            $sheet->setCellValue('F' . $row, $item['product_specs']);
+            $sheet->setCellValue('G' . $row, $item['online_posting_cunt']);
+            $sheet->setCellValue('H' . $row, $item['link_url']);
+            $sheet->setCellValue('I' . $row, $item['store_name']);
+            $sheet->setCellValue('J' . $row, $item['company_name']);
+            $sheet->setCellValue('K' . $row, $item['social_credit_code']);
+            $sheet->setCellValue('L' . $row, $item['province_name']);
+            $sheet->setCellValue('M' . $row, $item['city_name']);
+            $sheet->setCellValue('N' . $row, $source_responsible_person_name);
+            $sheet->setCellValue('O' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
+            $sheet->setCellValue('P' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
+            $sheet->setCellValue('Q' . $row, date('Y-m-d H:i:s', $item['insert_time']));
             $row++;
         }
         foreach (range('A', 'P') as $column) {