Skip to content

Commit

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

0 comments on commit 0d5c16a

Please sign in to comment.