Pārlūkot izejas kodu

[智价云] 去重更新

tangyuanwang 12 stundas atpakaļ
vecāks
revīzija
6f3781f399

+ 2 - 1
app/Models/Manager/Process/LowPriceGoods.php

@@ -137,8 +137,9 @@ class LowPriceGoods extends Model
                 $source_where[] = ['product_specs', '=', $data['product_specs']]; //规格
                 $source_where[] = ['scrape_date', '=', $data['scrape_date']]; //采集日期
             } else {
+                $source_where[] = ['company_id', '=', $data['company_id']]; //品牌方公司ID
                 $source_where[] = ['link_url', '=', $data['link_url']]; //链接地址
-                $source_where[] = ['scrape_date', '=', $data['scrape_date']]; //链接地址
+                $source_where[] = ['scrape_date', '=', $data['scrape_date']]; //采集日期
             }
             $source_id_log = $this->where($source_where)->select(['id', 'online_posting_price'])->first();
             if (!empty($source_id_log)) {

+ 4 - 3
app/Models/Manager/Process/ViolationProduct.php

@@ -121,18 +121,19 @@ class ViolationProduct extends Model
             if(!empty($source_data_log) && $source_data_log > 0) return true;
             // 如果是美团跟拼多多链接为动态
             if (in_array($data['platform'], ['3', '4'])) {
-                //去重规则:品牌方公司ID+店铺公司名称+店铺名称+品牌名称+商品名称+规格+盒数(针对采集)
+                //去重规则:品牌方公司ID+平台ID+公司名称+店铺名称+品牌名称+商品名称+规格+采集日期(针对采集)
                 $source_where[] = ['company_id', '=', $data['company_id']]; //品牌方公司ID
                 $source_where[] = ['platform', '=', $data['platform']]; //平台ID
-                $source_where[] = ['company_name', '=', $data['company_name']]; //店铺名称
+                $source_where[] = ['company_name', '=', $data['company_name']]; //公司名称
                 $source_where[] = ['store_name', '=', $data['store_name']]; //店铺名称
                 $source_where[] = ['product_brand', '=', $data['product_brand']]; //品牌名称
                 $source_where[] = ['product_name', '=', $data['product_name']]; //商品名称
                 $source_where[] = ['product_specs', '=', $data['product_specs']]; //规格
                 $source_where[] = ['scrape_date', '=', $data['scrape_date']]; //采集日期
             } else {
+                $source_where[] = ['company_id', '=', $data['company_id']]; //品牌方公司ID
                 $source_where[] = ['link_url', '=', $data['link_url']]; //链接地址
-                $source_where[] = ['scrape_date', '=', $data['scrape_date']]; //链接地址
+                $source_where[] = ['scrape_date', '=', $data['scrape_date']]; //采集日期
             }
             $source_id_log = $this->where($source_where)->count();
             if ($source_id_log > 0) {