Răsfoiți Sursa

[智价云] 缩短清洗查询时间范围

tangyuanwang 2 ore în urmă
părinte
comite
bfab66d64e

+ 4 - 4
app/Jobs/Manager/Process/LowPriceGoodsDataJobs.php

@@ -99,10 +99,10 @@ class LowPriceGoodsDataJobs implements ShouldQueue
         $ScrapeDataModel = $ScrapeDataModel->where([['min_price', '>=', '0.01'], ['number', '>=', '1']]);
         $start_time = time() - 60 * 5; // 开始时间 5分钟之前
         $end_time = time();//结束时间
-        $yesterdayStart = date('Y-m-d', $start_time);
-        $yesterdayEnd = date('Y-m-d', $end_time);
-        $where[] = ['scrape_date', '>=', $yesterdayStart];
-        $where[] = ['scrape_date', '<=', $yesterdayEnd];
+        $start_time_string = date('Y-m-d H:i:s', $start_time);
+        $end_time_string = date('Y-m-d H:i:s', $end_time);
+        $where[] = ['insert_time', '>=', $start_time_string];
+        $where[] = ['insert_time', '<=', $end_time_string];
         $where[] = ['product_name', 'like', '%' . $product_name . '%'];
         if ($enable_full_quantity == 1) $where[] = ['product_specs', 'like', '%' . $product_specs . '%']; //如果不是全量清洗,则查询规格
         // $where[] = ['one_box_price', '<', $suggested_price];

+ 4 - 4
app/Jobs/Manager/Process/ViolationCompanyDataJobs.php

@@ -87,10 +87,10 @@ class ViolationCompanyDataJobs implements ShouldQueue
 
         $start_time = time() - 60 * 5; // 开始时间 5分钟之前
         $end_time = time();//结束时间
-        $yesterdayStart = date('Y-m-d', $start_time);
-        $yesterdayEnd = date('Y-m-d', $end_time);
-        $where_map[] = ['scrape_date', '>=', $yesterdayStart];
-        $where_map[] = ['scrape_date', '<=', $yesterdayEnd];
+        $start_time_string = date('Y-m-d H:i:s', $start_time);
+        $end_time_string = date('Y-m-d H:i:s', $end_time);
+        $where_map[] = ['insert_time', '>=', $start_time_string];
+        $where_map[] = ['insert_time', '<=', $end_time_string];
 
         if ($platform != '0' && !empty($platform)) {
             $platform = explode(',', $platform);

+ 4 - 4
app/Jobs/Manager/Process/ViolationProductDataJobs.php

@@ -97,10 +97,10 @@ class ViolationProductDataJobs implements ShouldQueue
         }
         $start_time = time() - 60 * 5; // 开始时间 5分钟之前
         $end_time = time();//结束时间
-        $yesterdayStart = date('Y-m-d', $start_time);
-        $yesterdayEnd = date('Y-m-d', $end_time);
-        $where[] = ['scrape_date', '>=', $yesterdayStart];
-        $where[] = ['scrape_date', '<=', $yesterdayEnd];
+        $start_time_string = date('Y-m-d H:i:s', $start_time);
+        $end_time_string = date('Y-m-d H:i:s', $end_time);
+        $where[] = ['insert_time', '>=', $start_time_string];
+        $where[] = ['insert_time', '<=', $end_time_string];
         $where[] = ['product_name', 'like', '%' . $product_name . '%'];
         if ($enable_full_quantity == 1) $where[] = ['product_specs', 'like', '%' . $product_specs . '%']; //如果不是全量清洗,则查询规格
 

+ 4 - 4
app/Jobs/Manager/Process/ViolationStoreDataJobs.php

@@ -82,10 +82,10 @@ class ViolationStoreDataJobs implements ShouldQueue
 
         $start_time = time() - 60 * 5; // 开始时间 5分钟之前
         $end_time = time();//结束时间
-        $yesterdayStart = date('Y-m-d', $start_time);
-        $yesterdayEnd = date('Y-m-d', $end_time);
-        $where_map[] = ['scrape_date', '>=', $yesterdayStart];
-        $where_map[] = ['scrape_date', '<=', $yesterdayEnd];
+        $start_time_string = date('Y-m-d H:i:s', $start_time);
+        $end_time_string = date('Y-m-d H:i:s', $end_time);
+        $where_map[] = ['insert_time', '>=', $start_time_string];
+        $where_map[] = ['insert_time', '<=', $end_time_string];
 
         if ($platform != '0' && !empty($platform)) {
             $platform = explode(',', $platform);