Forráskód Böngészése

[智价云] 数据清洗配置公司查询

tangyuanwang 3 napja
szülő
commit
71b9a9ea88

+ 10 - 0
app/Http/Controllers/Manager/WashConfig/LowPriceGoods.php

@@ -49,6 +49,7 @@ class LowPriceGoods extends Controller
         $company_scope = request('company_scope', '');
         $category_id = request('category_id', '');
         $product_brand = request('product_brand', '');
+        $company_name = request('company_name', '');
         // 时间条件
         if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
         if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
@@ -74,6 +75,15 @@ class LowPriceGoods extends Controller
                     ->distinct('product_id');
             });
         }
+        if ($company_name) {
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('id', function ($query) use ($company_name) {
+                $query->select('washconfig_lowprice_product_company.lowprice_product_logid')
+                    ->from('washconfig_lowprice_product_company')
+                    ->join('washconfig_violation_store', 'washconfig_violation_store.id', '=', 'washconfig_lowprice_product_company.company_id')
+                    ->where('washconfig_violation_store.company_name', 'like', "%$company_name%")
+                    ->distinct('washconfig_lowprice_product_company.company_id');
+            });
+        }
         $result = $LowPriceGoodsModel
             ->where($map)
             ->with(['product_keyword'])

+ 10 - 0
app/Http/Controllers/Manager/WashConfig/ViolationProduct.php

@@ -49,6 +49,7 @@ class ViolationProduct extends Controller
         $company_scope = request('company_scope', '');
         $category_id = request('category_id', '');
         $product_brand = request('product_brand', '');
+        $company_name = request('company_name', '');
         // 时间条件
         if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
         if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
@@ -74,6 +75,15 @@ class ViolationProduct extends Controller
                     ->distinct('product_id');;
             });
         }
+        if ($company_name) {
+            $ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query) use ($company_name) {
+                $query->select('washconfig_violation_product_company.violation_product_logid')
+                    ->from('washconfig_violation_product_company')
+                    ->join('washconfig_violation_store', 'washconfig_violation_store.id', '=', 'washconfig_violation_product_company.company_id')
+                    ->where('washconfig_violation_store.company_name', 'like', "%$company_name%")
+                    ->distinct('washconfig_violation_product_company.company_id');
+            });
+        }
         $result = $ViolationProductModel
             ->where($map)
             ->with(['product_keyword'])