Bladeren bron

[智价云] 店铺搜索查询更新

tangyuanwang 4 weken geleden
bovenliggende
commit
6dbb5486a9
1 gewijzigde bestanden met toevoegingen van 6 en 1 verwijderingen
  1. 6 1
      app/Http/Controllers/Manager/Statistics/BasicPanel.php

+ 6 - 1
app/Http/Controllers/Manager/Statistics/BasicPanel.php

@@ -57,9 +57,11 @@ class BasicPanel extends Controller
         if ($is_admin != 1 && $company_id != 0) {
             $lowPriceGoodsModel = $lowPriceGoodsModel->where('company_id', $company_id);
             $violationProductModel = $violationProductModel->where('company_id', $company_id);
+            $violationStoreModel = $violationStoreModel->where('company_id', $company_id);
         } else {
             $lowPriceGoodsModel = $lowPriceGoodsModel->where('company_id', $admin_company_id);
             $violationProductModel = $violationProductModel->where('company_id', $admin_company_id);
+            $violationStoreModel = $violationStoreModel->where('company_id', $admin_company_id);
         }
 
         // 低价挂网商品数量查询
@@ -74,8 +76,11 @@ class BasicPanel extends Controller
             ->groupBy('product_name')
             ->count(DB::raw('DISTINCT product_name'));
 
+        $store_map = [];
+        if ($start_time) $store_map[] = ['insert_time', '>=', $start_time];
+        if ($end_time) $store_map[]   = ['insert_time', '<=', $end_time];
         // 违规店铺数量查询
-        $violationStoreCount = $violationStoreModel->where($map)
+        $violationStoreCount = $violationStoreModel->where($store_map)
             ->where('status', 0)
             ->groupBy('company_name')
             ->count(DB::raw('DISTINCT company_name'));