|
@@ -88,9 +88,25 @@ class BasicPanel extends Controller
|
|
|
->get()->count();
|
|
->get()->count();
|
|
|
|
|
|
|
|
//获取终端类型B端、C端、OTO,配置品规数量
|
|
//获取终端类型B端、C端、OTO,配置品规数量
|
|
|
- $collect_b_product_count = $productModel->whereIn('platform', ['5', '6', '7', '8', '9', '10'])->where('status', 0)->sum('product_specs_number');
|
|
|
|
|
- $collect_c_product_count = $productModel->whereIn('platform', ['1', '2', '3', '4'])->where('status', 0)->sum('product_specs_number');
|
|
|
|
|
- $collect_oto_product_count = $productModel->whereIn('platform', [])->where('status', 0)->sum('product_specs_number');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $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)->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)->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)->sum('product_specs_number');
|
|
|
|
|
|
|
|
// 所有终端品规数量
|
|
// 所有终端品规数量
|
|
|
$collect_totle_product_count = $collect_b_product_count + $collect_c_product_count + $collect_oto_product_count;
|
|
$collect_totle_product_count = $collect_b_product_count + $collect_c_product_count + $collect_oto_product_count;
|