diff --git a/src/Domain/Movie/MovieRepository.php b/src/Domain/Movie/MovieRepository.php index c64f45d6..0bbfb7b0 100644 --- a/src/Domain/Movie/MovieRepository.php +++ b/src/Domain/Movie/MovieRepository.php @@ -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],