diff --git a/market/controllers/api/sylive/GroupsStatistics.php b/market/controllers/api/sylive/GroupsStatistics.php index 55b89874..c8d79e55 100644 --- a/market/controllers/api/sylive/GroupsStatistics.php +++ b/market/controllers/api/sylive/GroupsStatistics.php @@ -454,10 +454,8 @@ class GroupsStatistics extends BaseController $start = date('Y-m-d H:i:s', $start_Time + 86400); } + $end = date('Y-m-d H:i:s', $start_Time + 86400); $name = date('Y-m-d', $start_Time); - $end_Time = $start_Time + $add_time; - $end = date('Y-m-d H:i:s', $end_Time); - $times[] = ['name' => $name, 'start' => $start, 'end' => $end]; $xAxisData[] = $name; } @@ -700,9 +698,11 @@ class GroupsStatistics extends BaseController } $consultantPer = number_format_com($consultant / $allConsultant * 100, 2, '') . '%'; $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, 'consultant' => $consultant, 'allConsultant' => $allConsultant, 'consultantPer' => $consultantPer , 'browse' => $v['browse'], 'subscribe' => $v['subscribe'], 'beforeOrder' => $v['beforeOrderTotal'], 'order' => $order, 'watch' => $v['watch'], 'livePV' => $livePV, 'watchDuration' => $watchDuration];