ajout recherche album
This commit is contained in:
@@ -57,4 +57,17 @@ class Model_music extends CI_Model {
|
||||
);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
public function searchAlbums($query){
|
||||
$this->db->select('album.name, 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->like('album.name', $query);
|
||||
$this->db->or_like('artist.name', $query);
|
||||
$this->db->order_by('album.id', 'ASC');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user