Procházet zdrojové kódy

[智价云] 增加违规数据处理规格模糊查询

tangyuanwang před 1 dnem
rodič
revize
c849c29746

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

@@ -98,6 +98,7 @@ class LowPriceGoods extends Controller
         if ($online_posting_min_price) $map[] = ['online_posting_price', '>=', $online_posting_min_price];
         if ($online_posting_max_price) $map[] = ['online_posting_price', '<=', $online_posting_max_price];
         if ($is_ultra_low_price) $map[] = ['is_ultra_low_price', '=', $is_ultra_low_price];
+        if ($product_specs)   $map[] = ['product_specs', 'like', "%$product_specs%"];
 
         $low_price_goods_where = [];
         // 权限判断
@@ -132,11 +133,6 @@ class LowPriceGoods extends Controller
             $online_posting_count = explode(',', $online_posting_count);
             $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('online_posting_count', $online_posting_count);
         }
-        //多选规格查询
-        if ($product_specs && is_string($product_specs)) {
-            $product_specs = explode(',', $product_specs);
-            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('product_specs', $product_specs);
-        }
         //多选商品查询
         if ($product_names && is_string($product_names)) {
             $product_names = explode(',', $product_names);
@@ -349,6 +345,7 @@ class LowPriceGoods extends Controller
         if ($online_posting_min_price) $map[] = ['online_posting_price', '>=', $online_posting_min_price];
         if ($online_posting_max_price) $map[] = ['online_posting_price', '<=', $online_posting_max_price];
         if ($is_ultra_low_price) $map[] = ['is_ultra_low_price', '=', $is_ultra_low_price];
+        if ($product_specs)   $map[] = ['product_specs', 'like', "%$product_specs%"];
 
         $admin_company_id = $message_data['admin_company_id'];
         $company_id = $message_data['company_id'];
@@ -388,11 +385,6 @@ class LowPriceGoods extends Controller
             $online_posting_count = explode(',', $online_posting_count);
             $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('online_posting_count', $online_posting_count);
         }
-        //多选规格查询
-        if ($product_specs && is_string($product_specs)) {
-            $product_specs = explode(',', $product_specs);
-            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('product_specs', $product_specs);
-        }
         //多选商品查询
         if ($product_names && is_string($product_names)) {
             $product_names = explode(',', $product_names);
@@ -745,9 +737,9 @@ class LowPriceGoods extends Controller
         } else {
             $company_id  = $admin_company_id;
         }
-        $start_time =  Carbon::yesterday()->startOfDay()->getTimestamp(); // 昨天开始时间 00:00:00
-        $end_time = Carbon::yesterday()->endOfDay()->getTimestamp(); // 昨天结束时间 23:59:59
-        $message_data = ['company_id' => $company_id, 'page' => '1', 'limit' => '10000', 'start_time' => $start_time, 'end_time' => $end_time];
+        $start_time =  Carbon::today()->startOfDay()->getTimestamp(); // 今天开始时间 00:00:00
+        $end_time = Carbon::today()->endOfDay()->getTimestamp(); // 今天结束时间 23:59:59
+        $message_data = ['company_id' => 8, 'page' => '1', 'limit' => '10000', 'start_time' => $start_time, 'end_time' => $end_time];
         //执行低价挂网商品数据清洗任务
         ScrapeDataProductJobs::dispatch($message_data);
         // ScrapeDataProductJobs::dispatchSync($message_data);

+ 2 - 10
app/Http/Controllers/Manager/Process/ViolationProduct.php

@@ -92,6 +92,7 @@ class ViolationProduct extends Controller
         if ($online_posting_cunt) $map[] = ['online_posting_count', '=', $online_posting_cunt];
         if ($continuous_listing_count) $map[] = ['continuous_listing_count', '=', $continuous_listing_count];
         if ($product_brand) $map[] = ['product_brand', 'like', "%$product_brand%"];
+        if ($product_specs)   $map[] = ['product_specs', 'like', "%$product_specs%"];
 
         $violation_product_where = [];
         // 权限判断
@@ -127,11 +128,6 @@ class ViolationProduct extends Controller
             $online_posting_count = explode(',', $online_posting_count);
             $ViolationProductModel = $ViolationProductModel->whereIn('online_posting_count', $online_posting_count);
         }
-        //多选规格查询
-        if ($product_specs && is_string($product_specs)) {
-            $product_specs = explode(',', $product_specs);
-            $ViolationProductModel = $ViolationProductModel->whereIn('product_specs', $product_specs);
-        }
         //多选商品查询
         if ($product_names && is_string($product_names)) {
             $product_names = explode(',', $product_names);
@@ -338,6 +334,7 @@ class ViolationProduct extends Controller
         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%"];
+        if ($product_specs)   $map[] = ['product_specs', 'like', "%$product_specs%"];
 
         $violation_product_where = [];
         // 权限判断
@@ -372,11 +369,6 @@ class ViolationProduct extends Controller
             $online_posting_count = explode(',', $online_posting_count);
             $ViolationProductModel = $ViolationProductModel->whereIn('online_posting_count', $online_posting_count);
         }
-        //多选规格查询
-        if ($product_specs && is_string($product_specs)) {
-            $product_specs = explode(',', $product_specs);
-            $ViolationProductModel = $ViolationProductModel->whereIn('product_specs', $product_specs);
-        }
         //多选商品查询
         if ($product_names && is_string($product_names)) {
             $product_names = explode(',', $product_names);

+ 1 - 5
app/Jobs/Manager/Other/ExportLowPriceGoodsJobs.php

@@ -122,6 +122,7 @@ class ExportLowPriceGoodsJobs implements ShouldQueue
         $is_ultra_low_price = $message_data['is_ultra_low_price'] ?? '';
         $merge_city_ids = $message_data['merge_city_ids'] ?? '';
         $merge_province_ids = $message_data['merge_province_ids'] ?? '';
+        if ($product_specs)   $map[] = ['product_specs', 'like', "%$product_specs%"];
 
         // 时间条件
         if ($collection_time_start_time) $map[] = ['collection_time', '>=', strtotime($collection_time_start_time)];
@@ -171,11 +172,6 @@ class ExportLowPriceGoodsJobs implements ShouldQueue
             $online_posting_count = explode(',', $online_posting_count);
             $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('online_posting_count', $online_posting_count);
         }
-        //多选规格查询
-        if ($product_specs && is_string($product_specs)) {
-            $product_specs = explode(',', $product_specs);
-            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('product_specs', $product_specs);
-        }
         //多选商品查询
         if ($product_names && is_string($product_names)) {
             $product_names = explode(',', $product_names);

+ 1 - 5
app/Jobs/Manager/Other/ExportViolationProductJobs.php

@@ -127,6 +127,7 @@ class ExportViolationProductJobs implements ShouldQueue
         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%"];
+        if ($product_specs)   $map[] = ['product_specs', 'like', "%$product_specs%"];
 
         $violation_product_where = [];
         // 权限判断
@@ -161,11 +162,6 @@ class ExportViolationProductJobs implements ShouldQueue
             $online_posting_count = explode(',', $online_posting_count);
             $ViolationProductModel = $ViolationProductModel->whereIn('online_posting_count', $online_posting_count);
         }
-        //多选规格查询
-        if ($product_specs && is_string($product_specs)) {
-            $product_specs = explode(',', $product_specs);
-            $ViolationProductModel = $ViolationProductModel->whereIn('product_specs', $product_specs);
-        }
         //多选商品查询
         if ($product_names && is_string($product_names)) {
             $product_names = explode(',', $product_names);