|
|
@@ -94,14 +94,23 @@ class LowPriceGoodsDataJobs implements ShouldQueue
|
|
|
|
|
|
//-------------------------------------- 清洗规则(开始) --------------------------------------
|
|
|
//过滤没有链接数据
|
|
|
- if (trim($product_data['link_url']) == '') return true;
|
|
|
+ if (trim($product_data['link_url']) == ''){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中链接数据', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
//过滤售罄数据,是否售罄0=否1=是
|
|
|
// if ($product_data['is_sold_out'] == 1) return true;
|
|
|
//数据是否命中低价
|
|
|
- if ($product_data['number'] < 1 || $product_data['min_price'] < 0.01) return true;
|
|
|
+ if ($product_data['number'] < 1 || $product_data['min_price'] < 0.01){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中数量', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
//计算单盒价格
|
|
|
$unit_price = round($product_data['min_price'] / $product_data['number'], 2);
|
|
|
- if ($unit_price > $suggested_price) return true;
|
|
|
+ if ($unit_price > $suggested_price){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中低价', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
$product_data['unit_price'] = $unit_price;
|
|
|
//数据是否命中商品名称
|
|
|
if ($product_name != '') {
|
|
|
@@ -109,7 +118,10 @@ class LowPriceGoodsDataJobs implements ShouldQueue
|
|
|
if (strpos($product_data['product_name'], $product_name) !== false) {
|
|
|
$hit_product_name = true;
|
|
|
}
|
|
|
- if ($hit_product_name != true) return true;
|
|
|
+ if ($hit_product_name != true){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中商品名称', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
//数据是否命中规格
|
|
|
if ($enable_full_quantity == 1 && $product_specs) {
|
|
|
@@ -120,7 +132,10 @@ class LowPriceGoodsDataJobs implements ShouldQueue
|
|
|
} else if (strpos($product_data['product_specs'], $product_specs) !== false) {
|
|
|
$hit_product_specs = true;
|
|
|
}
|
|
|
- if ($hit_product_specs != true) return true;
|
|
|
+ if ($hit_product_specs != true){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中规格', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//数据是否命中关键字
|
|
|
@@ -134,7 +149,10 @@ class LowPriceGoodsDataJobs implements ShouldQueue
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if ($hit_product_keywords != true) return true;
|
|
|
+ if ($hit_product_keywords != true){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中关键字', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
//数据是否命中指定公司
|
|
|
if ($company_scope == 2 && $social_credit_code != '') {
|
|
|
@@ -142,7 +160,10 @@ class LowPriceGoodsDataJobs implements ShouldQueue
|
|
|
if ($product_data['qualification_number'] == $social_credit_code) {
|
|
|
$hit_company_scope = true;
|
|
|
}
|
|
|
- if ($hit_company_scope != true) return true;
|
|
|
+ if ($hit_company_scope != true){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中指定公司', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//数据是否命中平台
|
|
|
@@ -152,7 +173,10 @@ class LowPriceGoodsDataJobs implements ShouldQueue
|
|
|
if (in_array($product_data['platform_id'], $platform)) {
|
|
|
$hit_platform = true;
|
|
|
}
|
|
|
- if ($hit_platform != true) return true;
|
|
|
+ if ($hit_platform != true){
|
|
|
+ // Log::info('job_error', '数据清洗-低价挂网商品队列日志,未命中平台', ['data' => $this->message_data]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
//-------------------------------------- 清洗规则(结束) --------------------------------------
|
|
|
|