|
|
@@ -90,25 +90,28 @@ class BasicPanel extends Controller
|
|
|
->get()->count();
|
|
|
|
|
|
//获取终端类型B端、C端、OTO,配置品规数量
|
|
|
+ $productModel_map = [];
|
|
|
+ if ($start_time) $productModel_map[] = ['insert_time', '>=', $start_time];
|
|
|
+ if ($end_time) $productModel_map[] = ['insert_time', '<=', $end_time];
|
|
|
|
|
|
$collect_b_product_count = $productModel->where(function ($query) {
|
|
|
$platforms = ['0', '5', '6', '7', '8', '9', '10'];
|
|
|
foreach ($platforms as $platform) {
|
|
|
$query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
}
|
|
|
- })->where('status', 0)->groupby('product_name')->sum('product_specs_number');
|
|
|
+ })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
|
|
|
$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)->groupby('product_name')->sum('product_specs_number');
|
|
|
+ })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
|
|
|
$collect_oto_product_count = $productModel->where(function ($query) {
|
|
|
$platforms = ['0'];
|
|
|
foreach ($platforms as $platform) {
|
|
|
$query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
}
|
|
|
- })->where('status', 0)->groupby('product_name')->sum('product_specs_number');
|
|
|
+ })->where('status', 0)->where($productModel_map)->groupby('product_name')->sum('product_specs_number');
|
|
|
|
|
|
// 所有终端品规数量
|
|
|
$collect_totle_product_count = $collect_b_product_count + $collect_c_product_count + $collect_oto_product_count;
|