test filtre 4/?

This commit is contained in:
2024-06-04 16:39:51 +02:00
parent d9c01b0729
commit 3796662e08
3 changed files with 6 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ class Model_music extends CI_Model {
$this->load->database();
}
public function getAlbums($genre = '', $order = 'asc', $artist = '') {
public function getAlbums($genre = '', $order = 'asc', $artist = '', $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');
@@ -16,6 +16,10 @@ class Model_music extends CI_Model {
$this->db->where('genre.name', $genre);
}
if(!empty($query)){
$this->db->where('album.name', $query);
}
if(!empty($artist)){
$this->db->where('artist.name', $artist);
}