|
@@ -11,6 +11,7 @@ use App\Models\Manager\Collect\Product as ProductModel;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Carbon;
|
|
use Illuminate\Support\Carbon;
|
|
|
use App\Models\Manager\Collect\ProductTask as ProductTaskModel;
|
|
use App\Models\Manager\Collect\ProductTask as ProductTaskModel;
|
|
|
|
|
+use PhpParser\Node\Stmt\Foreach_;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 数据分析-基础概览面板
|
|
* 数据分析-基础概览面板
|
|
@@ -180,7 +181,36 @@ class BasicPanel extends Controller
|
|
|
}
|
|
}
|
|
|
//获取所有终端品规数量
|
|
//获取所有终端品规数量
|
|
|
$collect_totle_product_count = $collect_b_product_count + $collect_c_product_count;
|
|
$collect_totle_product_count = $collect_b_product_count + $collect_c_product_count;
|
|
|
-
|
|
|
|
|
|
|
+ //合并去重C端品规,以及B端品规数据
|
|
|
|
|
+ $collect_product_list_data =[];
|
|
|
|
|
+ if(count($collect_c_product_list) > 0){
|
|
|
|
|
+ foreach ($collect_c_product_list as $key => $value) {
|
|
|
|
|
+ $product_specs_name =$key;
|
|
|
|
|
+ if(count($value)){
|
|
|
|
|
+ foreach ($value as $k => $v) {
|
|
|
|
|
+ $product_specs_name = $product_specs_name .'_'. $v;
|
|
|
|
|
+ $collect_product_list_data[$product_specs_name] ='1';
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $collect_product_list_data[$key] ='1';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(count($collect_b_product_list) > 0){
|
|
|
|
|
+ foreach ($collect_b_product_list as $key => $value) {
|
|
|
|
|
+ $product_specs_name =$key;
|
|
|
|
|
+ if(count($value)){
|
|
|
|
|
+ foreach ($value as $k => $v) {
|
|
|
|
|
+ $product_specs_name = $product_specs_name .'_'. $v;
|
|
|
|
|
+ $collect_product_list_data[$product_specs_name] ='1';
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $collect_product_list_data[$key] ='1';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //显示去重后的数量
|
|
|
|
|
+ $collect_totle_product_count = count($collect_product_list_data);
|
|
|
$result_data = [
|
|
$result_data = [
|
|
|
'collect_b_product_count' => $collect_b_product_count, // B端品规数量
|
|
'collect_b_product_count' => $collect_b_product_count, // B端品规数量
|
|
|
'collect_c_product_count' => $collect_c_product_count, // C端品规数量
|
|
'collect_c_product_count' => $collect_c_product_count, // C端品规数量
|