From 5c95018ddfb1be7ee50abbc4fa72d7c9624b8868 Mon Sep 17 00:00:00 2001 From: Ruben Date: Fri, 31 Mar 2017 12:33:55 +0200 Subject: [PATCH] Stats per day --- src/Api/StatsControllerProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Api/StatsControllerProvider.php b/src/Api/StatsControllerProvider.php index 9e948b2..ddd4ed2 100644 --- a/src/Api/StatsControllerProvider.php +++ b/src/Api/StatsControllerProvider.php @@ -27,7 +27,7 @@ class StatsControllerProvider implements ControllerProviderInterface $controllers->get('/', function (Application $app) { $gameRepo = $this->_eh->getEm()->getRepository(Models\Game::class); - + $stats = [ 'new_games' => [], 'new_users' => [], @@ -35,7 +35,7 @@ class StatsControllerProvider implements ControllerProviderInterface for ($i=0; $i < 14; $i++) { $day = date('Y-m-d',strtotime("-$i days")); - $stats['new_games'] = $gameRepo->getCreatedCountOnDate($day); + $stats['new_games'][$day] = $gameRepo->getCreatedCountOnDate($day); } return $app['serializer']->serialize($stats, 'json'); });