Skip to content

Commit

Permalink
Fix top locations query
Browse files Browse the repository at this point in the history
  • Loading branch information
leepeuker committed Aug 25, 2024
1 parent 008b531 commit 2a04179
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Domain/Movie/MovieRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,11 @@ public function fetchTmdbIdsWithoutWatchDateByUserId(int $userId, array $movieId
public function fetchTopLocations(int $userId) : array
{
return $this->dbConnection->executeQuery(
'SELECT location_id as id, name, COUNT(muwd.movie_id) AS count_plays
'SELECT location_id, name, COUNT(muwd.movie_id) AS count_plays
FROM location
JOIN movie_user_watch_dates muwd on location.id = muwd.location_id
WHERE location.user_id = ?
GROUP BY location_id',
JOIN main.movie_user_watch_dates muwd on location.id = muwd.location_id
GROUP BY location_id
ORDER BY count_plays DESC',
[$userId],
)->fetchAllAssociative();
}
Expand Down

0 comments on commit 2a04179

Please sign in to comment.