|
|
@@ -110,14 +110,18 @@ class LowPriceGoodsDataJobs implements ShouldQueue
|
|
|
// $where[] = ['one_box_price', '<', $suggested_price];
|
|
|
|
|
|
$ScrapeDataModel= $ScrapeDataModel->whereRaw('(min_price / NULLIF(number, 0)) < '. floatval($suggested_price));//计算单盒价格
|
|
|
-
|
|
|
// if ($product_brand) $where[] = ['product_name', 'like', '%' . $product_brand . '%'];
|
|
|
if ($product_brand) $where[] = ['product_brand', 'like', '%' . $category_name . '%'];
|
|
|
if (!empty($product_keyword)) {
|
|
|
- foreach ($product_keywords as $key => $keywords) {
|
|
|
- if (trim($keywords) == '') continue;
|
|
|
- $where[] = ['product_name', 'like', '%' . $keywords . '%'];
|
|
|
- }
|
|
|
+ $ScrapeDataModel = $ScrapeDataModel->where(function ($query) use ($product_keywords) {
|
|
|
+ // 平台条件(固定)
|
|
|
+ $query->where(function ($query_li) use ($product_keywords) {
|
|
|
+ foreach ($product_keywords as $product_keyword) {
|
|
|
+ if (empty($product_keyword)) continue;
|
|
|
+ $query_li->orWhere([['product_name', 'like', '%' . $product_keyword . '%']]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
if ($company_scope == 2 && $social_credit_code != '') {
|
|
|
$ScrapeDataModel->whereIn('qualification_number', $social_credit_code);
|