Browse Source

[智价云] 导出字段补充

tangyuanwang 2 days ago
parent
commit
aa8564ae80

+ 5 - 0
app/Http/Controllers/Manager/Process/LowPriceGoods.php

@@ -57,6 +57,7 @@ class LowPriceGoods extends Controller
         $company_name = request('company_name', '');
         $company_names = request('company_names', '');
         $store_name = request('store_name', '');
+        $anonymous_store_name = request('anonymous_store_name', '');
         $store_names = request('store_names', '');
         $source_responsible_person = request('source_responsible_person', '');
         $processing_status = request('processing_status', '');
@@ -77,6 +78,7 @@ class LowPriceGoods extends Controller
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($anonymous_store_name) $map[]   = ['anonymous_store_name', 'like', "%$anonymous_store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
         if ($company_name) $map[] = ['company_name', 'like', "%$company_name%"];
         if ($id) $map[] = ['id', '=', $id];
@@ -240,6 +242,7 @@ class LowPriceGoods extends Controller
         $message_data['company_name'] = request('company_name', '');
         $message_data['company_names'] = request('company_names', '');
         $message_data['store_name'] = request('store_name', '');
+        $message_data['anonymous_store_name']  = request('anonymous_store_name', '');
         $message_data['store_names'] = request('store_names', '');
         $message_data['source_responsible_person'] = request('source_responsible_person', '');
         $message_data['processing_status'] = request('processing_status', '');
@@ -282,6 +285,7 @@ class LowPriceGoods extends Controller
         $platform = $message_data['platform'] ?? '';
         $company_name = $message_data['company_name'] ?? '';
         $store_name = $message_data['store_name'] ?? '';
+        $anonymous_store_name  = request('anonymous_store_name', '');
         $store_names = $message_data['store_names'] ?? '';
         $source_responsible_person = $message_data['source_responsible_person'] ?? '';
         $processing_status = $message_data['processing_status'] ?? '';
@@ -299,6 +303,7 @@ class LowPriceGoods extends Controller
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($anonymous_store_name) $map[]   = ['anonymous_store_name', 'like', "%$anonymous_store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
         if ($product_brand) $map[] = ['product_brand', 'like', "%$product_brand%"];
 

+ 5 - 0
app/Http/Controllers/Manager/Process/ViolationProduct.php

@@ -56,6 +56,7 @@ class ViolationProduct extends Controller
         $company_name = request('company_name', '');
         $company_names = request('company_names', '');
         $store_name = request('store_name', '');
+        $anonymous_store_name  = request('anonymous_store_name', '');
         $store_names = request('store_names', '');
         $source_responsible_person = request('source_responsible_person', '');
         $processing_status = request('processing_status', '');
@@ -76,6 +77,7 @@ class ViolationProduct extends Controller
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($anonymous_store_name) $map[]   = ['anonymous_store_name', 'like', "%$anonymous_store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
         if ($company_name) $map[] = ['company_name', 'like', "%$company_name%"];
         if ($id) $map[] = ['id', '=', $id];
@@ -239,6 +241,7 @@ class ViolationProduct extends Controller
         $message_data['company_name'] = request('company_name', '');
         $message_data['company_names'] = request('company_names', '');
         $message_data['store_name'] = request('store_name', '');
+        $message_data['anonymous_store_name'] = request('anonymous_store_name', '');
         $message_data['store_names'] = request('store_names', '');
         $message_data['source_responsible_person'] = request('source_responsible_person', '');
         $message_data['processing_status'] = request('processing_status', '');
@@ -284,6 +287,7 @@ class ViolationProduct extends Controller
         $platform = $message_data['platform'] ?? '';
         $company_name = $message_data['company_name'] ?? '';
         $store_name = $message_data['store_name'] ?? '';
+        $anonymous_store_name = $message_data['anonymous_store_name'] ?? '';
         $store_names = $message_data['store_names'] ?? '';
         $source_responsible_person = $message_data['source_responsible_person'] ?? '';
         $processing_status = $message_data['processing_status'] ?? '';
@@ -301,6 +305,7 @@ class ViolationProduct extends Controller
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($anonymous_store_name) $map[]   = ['anonymous_store_name', 'like', "%$anonymous_store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
         if ($product_brand) $map[] = ['product_brand', 'like', "%$product_brand%"];
 

+ 53 - 44
app/Jobs/Manager/Other/ExportLowPriceGoodsJobs.php

@@ -102,6 +102,7 @@ class ExportLowPriceGoodsJobs implements ShouldQueue
         $platform = $message_data['platform'] ?? '';
         $company_name = $message_data['company_name'] ?? '';
         $store_name = $message_data['store_name'] ?? '';
+        $anonymous_store_name = $message_data['anonymous_store_name'] ?? '';
         $store_names = $message_data['store_names'] ?? '';
         $source_responsible_person = $message_data['source_responsible_person'] ?? '';
         $processing_status = $message_data['processing_status'] ?? '';
@@ -120,6 +121,7 @@ class ExportLowPriceGoodsJobs implements ShouldQueue
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($anonymous_store_name) $map[]   = ['anonymous_store_name', 'like', "%$anonymous_store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
         if ($product_brand) $map[] = ['product_brand', 'like', "%$product_brand%"];
 
@@ -334,28 +336,30 @@ class ExportLowPriceGoodsJobs implements ShouldQueue
         $sheet->setCellValue('B2', '责任人');
         $sheet->setCellValue('C2', '平台');
         $sheet->setCellValue('D2', '商品分类');
-        $sheet->setCellValue('E2', '商品名称');
-        $sheet->setCellValue('F2', '库存');
-        $sheet->setCellValue('G2', '销量');
-        $sheet->setCellValue('H2', '快照URL');
-        $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', '省份');
-        $sheet->setCellValue('T2', '城市');
-        $sheet->setCellValue('U2', '溯源责任人');
-        $sheet->setCellValue('V2', '处理状态');
-        $sheet->setCellValue('W2', '任务状态');
-        $sheet->setCellValue('X2', '记录时间');
-        $sheet->setCellValue('Y2', '发货省份');
-        $sheet->setCellValue('Z2', '发货城市');
+        $sheet->setCellValue('E2', '品牌名称');
+        $sheet->setCellValue('F2', '商品名称');
+        $sheet->setCellValue('G2', '库存');
+        $sheet->setCellValue('H2', '销量');
+        $sheet->setCellValue('I2', '快照URL');
+        $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', '公司分类');
+        $sheet->setCellValue('T2', '信用代码');
+        $sheet->setCellValue('U2', '省份');
+        $sheet->setCellValue('V2', '城市');
+        $sheet->setCellValue('W2', '溯源责任人');
+        $sheet->setCellValue('X2', '处理状态');
+        $sheet->setCellValue('Y2', '任务状态');
+        $sheet->setCellValue('Z2', '记录时间');
+        $sheet->setCellValue('AA2', '发货省份');
+        $sheet->setCellValue('AB2', '发货城市');
 
         //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药11=药房网
         $platform_data = [
@@ -389,30 +393,35 @@ class ExportLowPriceGoodsJobs implements ShouldQueue
             $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['category_name']);
-            $sheet->setCellValue('E' . $row, $item['product_name']);
-            $sheet->setCellValue('F' . $row, $item['inventory']);
-            $sheet->setCellValue('G' . $row, $item['sales']);
-            $sheet->setCellValue('H' . $row, $item['snapshot_url']);
-            $sheet->setCellValue('I' . $row, $item['product_specs']);
-            $sheet->setCellValue('J' . $row, $item['suggested_price']);
-            $sheet->setCellValue('K' . $row, $item['online_posting_price']);
-            $sheet->setCellValue('L' . $row, $item['online_posting_count']);
-            $sheet->setCellValue('M' . $row, $item['continuous_listing_count']);
-            $sheet->setCellValue('N' . $row, $item['link_url']);
-            $sheet->setCellValue('O' . $row, $item['store_name']);
-            $sheet->setCellValue('P' . $row, $item['company_name']);
-            $sheet->setCellValue('Q' . $row, $item['company_category_name']);
-            $sheet->setCellValue('R' . $row, $item['social_credit_code']);
-            $sheet->setCellValue('S' . $row, $item['province_name']);
-            $sheet->setCellValue('T' . $row, $item['city_name']);
-            $sheet->setCellValue('U' . $row, $source_responsible_person_name);
-            $sheet->setCellValue('V' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
-            $sheet->setCellValue('W' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
-            $sheet->setCellValue('X' . $row, date('Y-m-d H:i:s', $item['insert_time']));
-            $sheet->setCellValue('Y' . $row, $item['shipment_city_name']);
-            $sheet->setCellValue('Z' . $row, $item['shipment_city_name']);
+            $sheet->setCellValue('E' . $row, $item['product_brand']);
+            $sheet->setCellValue('F' . $row, $item['product_name']);
+            $sheet->setCellValue('G' . $row, $item['inventory']);
+            $sheet->setCellValue('H' . $row, $item['sales']);
+            $sheet->setCellValue('I' . $row, $item['snapshot_url']);
+            $sheet->setCellValue('J' . $row, $item['product_specs']);
+            $sheet->setCellValue('K' . $row, $item['suggested_price']);
+            $sheet->setCellValue('L' . $row, $item['online_posting_price']);
+            $sheet->setCellValue('M' . $row, $item['online_posting_count']);
+            $sheet->setCellValue('N' . $row, $item['continuous_listing_count']);
+            $sheet->setCellValue('O' . $row, $item['link_url']);
+            $sheet->setCellValue('P' . $row, $item['store_name']);
+            $sheet->setCellValue('Q' . $row, $item['anonymous_store_name']);
+            $sheet->setCellValue('R' . $row, $item['company_name']);
+            $sheet->setCellValue('S' . $row, $item['company_category_name']);
+            $sheet->setCellValue('T' . $row, $item['social_credit_code']);
+            $sheet->setCellValue('U' . $row, $item['province_name']);
+            $sheet->setCellValue('V' . $row, $item['city_name']);
+            $sheet->setCellValue('W' . $row, $source_responsible_person_name);
+            $sheet->setCellValue('X' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
+            $sheet->setCellValue('Y' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
+            $sheet->setCellValue('Z' . $row, date('Y-m-d H:i:s', $item['insert_time']));
+            $sheet->setCellValue('AA' . $row, $item['shipment_province_name']);
+            $sheet->setCellValue('AB' . $row, $item['shipment_city_name']);
             $row++;
         }
+        foreach (range('A', 'AB') as $column) {
+            $sheet->getColumnDimension($column)->setAutoSize(true);
+        }
         // 创建Excel文件
         $filename = '低价挂网商品数据' . $file_id . '.xlsx';
         $path = public_path('uploads/exports/');

+ 47 - 41
app/Jobs/Manager/Other/ExportViolationProductJobs.php

@@ -99,6 +99,7 @@ class ExportViolationProductJobs implements ShouldQueue
         $platform = $message_data['platform'] ?? '';
         $company_name = $message_data['company_name'] ?? '';
         $store_name = $message_data['store_name'] ?? '';
+        $anonymous_store_name = $message_data['anonymous_store_name'] ?? '';
         $store_names = $message_data['store_names'] ?? '';
         $source_responsible_person = $message_data['source_responsible_person'] ?? '';
         $processing_status = $message_data['processing_status'] ?? '';
@@ -116,6 +117,7 @@ class ExportViolationProductJobs implements ShouldQueue
         // 其他条件
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($anonymous_store_name) $map[]   = ['anonymous_store_name', 'like', "%$anonymous_store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
         if ($product_brand) $map[] = ['product_brand', 'like', "%$product_brand%"];
 
@@ -330,26 +332,28 @@ class ExportViolationProductJobs implements ShouldQueue
         $sheet->setCellValue('B2', '责任人');
         $sheet->setCellValue('C2', '平台');
         $sheet->setCellValue('D2', '商品分类');
-        $sheet->setCellValue('E2', '商品名称');
-        $sheet->setCellValue('F2', '库存');
-        $sheet->setCellValue('G2', '销量');
-        $sheet->setCellValue('H2', '快照URL');
-        $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', '溯源责任人');
-        $sheet->setCellValue('T2', '处理状态');
-        $sheet->setCellValue('U2', '任务状态');
-        $sheet->setCellValue('V2', '记录时间');
-        $sheet->setCellValue('W2', '发货省份');
-        $sheet->setCellValue('X2', '发货城市');
+        $sheet->setCellValue('E2', '品牌名称');
+        $sheet->setCellValue('F2', '商品名称');
+        $sheet->setCellValue('G2', '库存');
+        $sheet->setCellValue('H2', '销量');
+        $sheet->setCellValue('I2', '快照URL');
+        $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', '省份');
+        $sheet->setCellValue('T2', '城市');
+        $sheet->setCellValue('U2', '溯源责任人');
+        $sheet->setCellValue('V2', '处理状态');
+        $sheet->setCellValue('W2', '任务状态');
+        $sheet->setCellValue('X2', '记录时间');
+        $sheet->setCellValue('Y2', '发货省份');
+        $sheet->setCellValue('Z2', '发货城市');
 
         //平台0=全部,1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药11=药房网
         $platform_data = [
@@ -383,29 +387,31 @@ class ExportViolationProductJobs implements ShouldQueue
             $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['category_name']);
-            $sheet->setCellValue('E' . $row, $item['product_name']);
-            $sheet->setCellValue('F' . $row, $item['inventory']);
-            $sheet->setCellValue('G' . $row, $item['sales']);
-            $sheet->setCellValue('H' . $row, $item['snapshot_url']);
-            $sheet->setCellValue('I' . $row, $item['product_specs']);
-            $sheet->setCellValue('J' . $row, $item['online_posting_count']);
-            $sheet->setCellValue('K' . $row, $item['continuous_listing_count']);
-            $sheet->setCellValue('L' . $row, $item['link_url']);
-            $sheet->setCellValue('M' . $row, $item['store_name']);
-            $sheet->setCellValue('N' . $row, $item['company_name']);
-            $sheet->setCellValue('O' . $row, $item['company_category_name']);
-            $sheet->setCellValue('P' . $row, $item['social_credit_code']);
-            $sheet->setCellValue('Q' . $row, $item['province_name']);
-            $sheet->setCellValue('R' . $row, $item['city_name']);
-            $sheet->setCellValue('S' . $row, $source_responsible_person_name);
-            $sheet->setCellValue('T' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
-            $sheet->setCellValue('U' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
-            $sheet->setCellValue('V' . $row, date('Y-m-d H:i:s', $item['insert_time']));
-            $sheet->setCellValue('W' . $row, $item['shipment_city_name']);
-            $sheet->setCellValue('X' . $row, $item['shipment_city_name']);
+            $sheet->setCellValue('E' . $row, $item['product_brand']);
+            $sheet->setCellValue('F' . $row, $item['product_name']);
+            $sheet->setCellValue('G' . $row, $item['inventory']);
+            $sheet->setCellValue('H' . $row, $item['sales']);
+            $sheet->setCellValue('I' . $row, $item['snapshot_url']);
+            $sheet->setCellValue('J' . $row, $item['product_specs']);
+            $sheet->setCellValue('K' . $row, $item['online_posting_count']);
+            $sheet->setCellValue('L' . $row, $item['continuous_listing_count']);
+            $sheet->setCellValue('M' . $row, $item['link_url']);
+            $sheet->setCellValue('N' . $row, $item['store_name']);
+            $sheet->setCellValue('O' . $row, $item['anonymous_store_name']);
+            $sheet->setCellValue('P' . $row, $item['company_name']);
+            $sheet->setCellValue('Q' . $row, $item['company_category_name']);
+            $sheet->setCellValue('R' . $row, $item['social_credit_code']);
+            $sheet->setCellValue('S' . $row, $item['province_name']);
+            $sheet->setCellValue('T' . $row, $item['city_name']);
+            $sheet->setCellValue('U' . $row, $source_responsible_person_name);
+            $sheet->setCellValue('V' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
+            $sheet->setCellValue('W' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
+            $sheet->setCellValue('X' . $row, date('Y-m-d H:i:s', $item['insert_time']));
+            $sheet->setCellValue('Y' . $row, $item['shipment_province_name']);
+            $sheet->setCellValue('Z' . $row, $item['shipment_city_name']);
             $row++;
         }
-        foreach (range('A', 'P') as $column) {
+        foreach (range('A', 'Z') as $column) {
             $sheet->getColumnDimension($column)->setAutoSize(true);
         }
         // 创建Excel文件