diff --git a/src/Controller/OverviewCardsController.php b/src/Controller/OverviewCardsController.php index 7b11896..cb26ff5 100644 --- a/src/Controller/OverviewCardsController.php +++ b/src/Controller/OverviewCardsController.php @@ -140,6 +140,7 @@ public function eventHistory( */ #[Route('/events/daily-chart', name: 'events_daily_chart')] public function eventDailyChart( + #[CurrentUser] User $user, SolutionEventRepository $solutionEventRepository, ChartBuilderInterface $chartBuilder, TranslatorInterface $translator, @@ -147,11 +148,14 @@ public function eventDailyChart( $startedAt = new \DateTimeImmutable('-7 days'); $eventsQuery = $solutionEventRepository->createQueryBuilder('e') + ->join('e.submitter', 'u') ->select('DATE(e.createdAt) as date, COUNT(e.id) as count') ->where('e.createdAt >= :date') + ->andWhere('u = :user') ->orderBy('date', 'ASC') ->groupBy('date') ->setParameter('date', $startedAt) + ->setParameter('user', $user) ->getQuery(); /**