diff --git a/market/controllers/api/sylive/GroupsStatistics.php b/market/controllers/api/sylive/GroupsStatistics.php index 4e69a53b..9ab3a090 100644 --- a/market/controllers/api/sylive/GroupsStatistics.php +++ b/market/controllers/api/sylive/GroupsStatistics.php @@ -452,9 +452,8 @@ class GroupsStatistics extends BaseController while ($start_Time < $end_Time) { $start = date('Y-m-d H:i:s', $start_Time); $ii > 0 && $start = date('Y-m-d H:i:s', $start_Time + 86400); - $name_start = date('Y-m-d', $start_Time); + $name = date('Y-m-d', $start_Time); $start_Time = strtotime($add_time, $start_Time); - $name = $name_start . '-' . date('Y-m-d', $start_Time); $end = date('Y-m-d H:i:s', $end_Time); $times[] = ['name' => $name, 'start' => $start, 'end' => $end]; $xAxisData[] = $name; @@ -468,11 +467,11 @@ class GroupsStatistics extends BaseController $end = strtotime($v2['end']); $where = ['createTime >=' => $start, 'createTime <=' => $end, 'activityId' => $activityId]; if ($v['value'] == 'order') { - $where['itemId>'] = 0; + $counts[] = $this->mdSyliveOrder->count(['activityId' => $activityId, 'itemId>' => 0, 'itemPrice >' => 0 , 'status' => 1, 'createTime >=' => $v2['start'], 'createTime <=' => $v2['end'],]); } else { $where['kpi'] = $v['value']; + $counts[] = $this->mdSyliveActivityKpidata->count($where); } - $counts[] = $this->mdSyliveActivityKpidata->count($where); } $yAxisSeries[] = ['name' => $v['name'], 'type' => 'line', 'data' => $counts]; }