Views music
This commit is contained in:
		@@ -153,36 +153,17 @@ class Model_music extends CI_Model {
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    public function getSongDetails($songId) {
 | 
			
		||||
        // Get song details
 | 
			
		||||
        $this->db->select('song.name as songName, song.id');
 | 
			
		||||
        $this->db->from('song');
 | 
			
		||||
        $this->db->where('song.id', $songId);
 | 
			
		||||
        $songQuery = $this->db->get();
 | 
			
		||||
        $songDetails = $songQuery->row();
 | 
			
		||||
    
 | 
			
		||||
        // Get album details for the song
 | 
			
		||||
        $this->db->select('album.id as albumId, album.name as albumName, album.year');
 | 
			
		||||
        $this->db->from('album');
 | 
			
		||||
        $this->db->join('track', 'track.albumId = album.id');
 | 
			
		||||
        $this->db->where('track.songId', $songId);
 | 
			
		||||
        $albumQuery = $this->db->get();
 | 
			
		||||
        $albumDetails = $albumQuery->row();
 | 
			
		||||
    
 | 
			
		||||
        // Get artist details for the album
 | 
			
		||||
        $this->db->select('artist.id as artistId, artist.name as artistName');
 | 
			
		||||
        $this->db->from('artist');
 | 
			
		||||
        $this->db->join('album', 'album.artistId = artist.id');
 | 
			
		||||
        $this->db->where('album.id', $albumDetails->albumId);
 | 
			
		||||
        $artistQuery = $this->db->get();
 | 
			
		||||
        $artistDetails = $artistQuery->row();
 | 
			
		||||
    
 | 
			
		||||
        return array('song' => $songDetails, 'album' => $albumDetails, 'artist' => $artistDetails);
 | 
			
		||||
        $this->db->select('song.name as songName, song.id as songId, album.name as albumName, album.id as albumId, album.year, artist.name as artistName, artist.id as artistId, cover.jpeg');
 | 
			
		||||
        $this->db->from('track');
 | 
			
		||||
        $this->db->join('album', 'track.albumId = album.id');
 | 
			
		||||
        $this->db->join('song', 'song.id = track.songId');
 | 
			
		||||
        $this->db->join('artist', 'album.artistid = artist.id');
 | 
			
		||||
        $this->db->join('cover', 'cover.id = album.coverid');
 | 
			
		||||
        $this->db->where('track.id', $songId);
 | 
			
		||||
 | 
			
		||||
        $result = $this->db->get();
 | 
			
		||||
        return $result->row_array();
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    // Suppression de la deuxième méthode researchtype
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user