瀏覽代碼

[智价云] 采集统计更新

tangyuanwang 4 周之前
父節點
當前提交
27cacca0a8
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      app/Http/Controllers/Manager/Statistics/BasicPanel.php

+ 11 - 0
app/Http/Controllers/Manager/Statistics/BasicPanel.php

@@ -90,6 +90,7 @@ class BasicPanel extends Controller
             ->get()->count();
 
         //获取终端类型B端、C端、OTO,配置品规数量
+        $productModel = new ProductModel();
         $productModel_map = [];
         if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
         if ($end_time) $productModel_map[]   = ['insert_time', '<=', $end_time];
@@ -100,12 +101,22 @@ class BasicPanel extends Controller
                 $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
             }
         })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
+
+        $productModel = new ProductModel();
+        $productModel_map = [];
+        if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
+        if ($end_time) $productModel_map[]   = ['insert_time', '<=', $end_time];
         $collect_c_product_count = $productModel->where(function ($query) {
             $platforms = ['0', '1', '2', '3', '4'];
             foreach ($platforms as $platform) {
                 $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
             }
         })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
+
+        $productModel = new ProductModel();
+        $productModel_map = [];
+        if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
+        if ($end_time) $productModel_map[]   = ['insert_time', '<=', $end_time];
         $collect_oto_product_count = $productModel->where(function ($query) {
             $platforms = ['0'];
             foreach ($platforms as $platform) {