diff --git a/models/Movie.php b/models/Movie.php index 6eedf26..edad9b8 100644 --- a/models/Movie.php +++ b/models/Movie.php @@ -57,11 +57,10 @@ class Movie { // 3. Commune $stmt = $this->db->prepare(" - SELECT * + SELECT MAX(id) as id, tmdb_id, title, poster_path, media_type, is_common, MAX(added_at) as added_at FROM movies WHERE is_common = 1 - GROUP BY tmdb_id - ORDER BY added_at DESC + GROUP BY tmdb_id, title, poster_path, media_type, is_common "); $stmt->execute(); $common = $stmt->fetchAll(PDO::FETCH_ASSOC);