test filtre 4/?
This commit is contained in:
		@@ -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);
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user