public пре 4 недеља
родитељ
комит
2fdc2f4d95
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6 4
      app/Http/Controllers/Manager/Statistics/BasicPanel.php

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

@@ -68,13 +68,14 @@ class BasicPanel extends Controller
         $lowPriceGoodsCount = $lowPriceGoodsModel->where($map)
             ->where('status', 0)
             ->groupBy('product_name')
-            ->count(DB::raw('DISTINCT product_name'));
-
+            ->select('product_name')
+            ->get()->count();
         // 禁止挂网商品数量查询
         $violationProductCount = $violationProductModel->where($map)
             ->where('status', 0)
             ->groupBy('product_name')
-            ->count(DB::raw('DISTINCT product_name'));
+            ->select('product_name')
+            ->get()->count();
 
         $store_map = [];
         if ($start_time) $store_map[] = ['insert_time', '>=', $start_time];
@@ -83,7 +84,8 @@ class BasicPanel extends Controller
         $violationStoreCount = $violationStoreModel->where($store_map)
             ->where('status', 0)
             ->groupBy('company_name')
-            ->count(DB::raw('DISTINCT company_name'));
+            ->select('company_name')
+            ->get()->count();
 
         //获取终端类型B端、C端、OTO,配置品规数量
         $collect_b_product_count = $productModel->whereIn('platform', ['5', '6', '7', '8', '9', '10'])->where('status', 0)->sum('product_specs_number');