From 1c75469b90dbfbfb69cd344458e38132bdee762c Mon Sep 17 00:00:00 2001 From: stiti Date: Mon, 10 Jun 2024 17:43:35 +0200 Subject: [PATCH] Commit de louay --- CodeIgniter-3.1.13/application/models/Model_playlist.php | 6 ++++-- CodeIgniter-3.1.13/application/views/playlist_view.php | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CodeIgniter-3.1.13/application/models/Model_playlist.php b/CodeIgniter-3.1.13/application/models/Model_playlist.php index 34e884b..4186476 100644 --- a/CodeIgniter-3.1.13/application/models/Model_playlist.php +++ b/CodeIgniter-3.1.13/application/models/Model_playlist.php @@ -113,13 +113,15 @@ class Model_playlist extends CI_Model { } public function get_songs_by_playlist($playlist_id) { - $this->db->select('song.*, artist.name as artist_name'); + $this->db->select('song.*, artist.name as artist_name, album.id as album_id, album.name as album_name'); // Ajoutez album.id à la sélection $this->db->from('playlist_song'); $this->db->join('song', 'song.id = playlist_song.song_id'); $this->db->join('artist', 'artist.id = song.artistId'); + $this->db->join('track', 'track.songId = song.id'); + $this->db->join('album', 'album.id = track.albumId'); $this->db->where('playlist_song.playlist_id', $playlist_id); return $this->db->get()->result(); - } + } public function get_song_id_by_track_id($track_id) { $this->db->select('songId'); diff --git a/CodeIgniter-3.1.13/application/views/playlist_view.php b/CodeIgniter-3.1.13/application/views/playlist_view.php index cca5ea0..b70edc9 100644 --- a/CodeIgniter-3.1.13/application/views/playlist_view.php +++ b/CodeIgniter-3.1.13/application/views/playlist_view.php @@ -45,6 +45,7 @@ Titre Artiste + Album Écouter sur session->userdata('user_id') === $playlist->utilisateur_id): ?> Actions @@ -56,6 +57,7 @@ name, ENT_QUOTES, 'UTF-8'); ?> artist_name, ENT_QUOTES, 'UTF-8'); ?> + album_name, ENT_QUOTES, 'UTF-8'); ?> Spotify | Deezer |