From 85735da8a9e1fe8189851e5a912f7563ccc00a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Fri, 12 Jul 2024 22:09:42 +0800 Subject: [PATCH] bo --- .../controllers/api/sylive/GroupsStatistics.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/market/controllers/api/sylive/GroupsStatistics.php b/market/controllers/api/sylive/GroupsStatistics.php index bef4c00d..1950851b 100644 --- a/market/controllers/api/sylive/GroupsStatistics.php +++ b/market/controllers/api/sylive/GroupsStatistics.php @@ -459,6 +459,7 @@ class GroupsStatistics extends BaseController $name = date('Y-m-d', $start_Time); $times[] = ['name' => $name, 'start' => $start, 'end' => $end]; $xAxisData[] = $name; + $i++; } foreach ($legend_data as $v) { $legendData[] = $v['name']; @@ -941,9 +942,11 @@ class GroupsStatistics extends BaseController } } $list1 = []; - foreach ($levels as $k2 => $v2) { - $levelId = $v2['levelId']; - $list1[$v2['prop']] = $map_groups[$v[$levelId]] ? $map_groups[$v[$levelId]] : ''; + if($levels){ + foreach ($levels as $k2 => $v2) { + $levelId = $v2['levelId']; + $list1[$v2['prop']] = $map_groups[$v[$levelId]] ? $map_groups[$v[$levelId]] : ''; + } } $list2 = ['bizName' => $bizName, 'consultantName' => $consultantName, 'browse' => $browse, 'subscribe' => $subscribe, 'beforeOrder' => $beforeOrderTotal, 'order' => $order, 'watch' => $watch, 'livePV' => $livePV, 'watchDuration' => $watchDuration]; @@ -958,8 +961,10 @@ class GroupsStatistics extends BaseController $columns = ''; if ($page == 1) { $columns1 = []; - foreach ($levels as $k => $v) { - $columns1[] = ['prop' => $v['prop'], 'label' => $v['label'], 'align' => 'center', 'showOverflowTooltip' => true, 'minWidth' => 80]; + if($levels){ + foreach ($levels as $k => $v) { + $columns1[] = ['prop' => $v['prop'], 'label' => $v['label'], 'align' => 'center', 'showOverflowTooltip' => true, 'minWidth' => 80]; + } } $columns2 = [ ['prop' => 'bizName', 'label' => '门店', 'align' => 'center', 'showOverflowTooltip' => true, 'minWidth' => 120],