Skip to content

Commit

Permalink
fix(overview): Pass user to daily chart
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 committed Oct 19, 2024
1 parent d93ef8f commit f30fb14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Controller/OverviewCardsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,22 @@ public function eventHistory(
*/
#[Route('/events/daily-chart', name: 'events_daily_chart')]
public function eventDailyChart(
#[CurrentUser] User $user,
SolutionEventRepository $solutionEventRepository,
ChartBuilderInterface $chartBuilder,
TranslatorInterface $translator,
): Response {
$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();

/**
Expand Down

0 comments on commit f30fb14

Please sign in to comment.