Test details album
This commit is contained in:
		@@ -102,6 +102,29 @@ class Model_music extends CI_Model {
 | 
			
		||||
        return $result->result();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getAlbumDetails($albumId) {
 | 
			
		||||
        // Get album info
 | 
			
		||||
        $this->db->select('album.name as albumName, album.id, year, artist.name as artistName, genre.name as genreName, jpeg');
 | 
			
		||||
        $this->db->from('album');
 | 
			
		||||
        $this->db->join('artist', 'album.artistid = artist.id');
 | 
			
		||||
        $this->db->join('genre', 'genre.id = album.genreid');
 | 
			
		||||
        $this->db->join('cover', 'cover.id = album.coverid');
 | 
			
		||||
        $this->db->where('album.id', $albumId);
 | 
			
		||||
        $albumQuery = $this->db->get();
 | 
			
		||||
        $albumDetails = $albumQuery->row();
 | 
			
		||||
    
 | 
			
		||||
        // Get album songs
 | 
			
		||||
        $this->db->select('song.name as trackName, track.id as trackId');
 | 
			
		||||
        $this->db->from('track');
 | 
			
		||||
        $this->db->join('song', 'track.songId = song.id');
 | 
			
		||||
        $this->db->where('track.albumId', $albumId);
 | 
			
		||||
        $songsQuery = $this->db->get();
 | 
			
		||||
        $songs = $songsQuery->result();
 | 
			
		||||
    
 | 
			
		||||
        return array('album' => $albumDetails, 'songs' => $songs);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    // Suppression de la deuxième méthode researchtype
 | 
			
		||||
 | 
			
		||||
    public function research(){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user