Test details artiste 1/?
This commit is contained in:
@@ -123,6 +123,26 @@ class Model_music extends CI_Model {
|
||||
|
||||
return array('album' => $albumDetails, 'songs' => $songs);
|
||||
}
|
||||
public function getArtistDetails($artistId) {
|
||||
// Get artist info
|
||||
$this->db->select('artist.name as artistName, artist.id, genre.name as genreName, artist.jpeg');
|
||||
$this->db->from('artist');
|
||||
$this->db->join('album', 'album.artistid = artist.id');
|
||||
$this->db->join('genre', 'genre.id = album.genreid');
|
||||
$this->db->where('artist.id', $artistId);
|
||||
$artistQuery = $this->db->get();
|
||||
$artistDetails = $artistQuery->row();
|
||||
|
||||
// Get artist's albums
|
||||
$this->db->select('album.name as albumName, album.id as albumId, album.year');
|
||||
$this->db->from('album');
|
||||
$this->db->where('album.artistid', $artistId);
|
||||
$albumsQuery = $this->db->get();
|
||||
$albums = $albumsQuery->result();
|
||||
|
||||
return array('artist' => $artistDetails, 'albums' => $albums);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user