ajout recherche album

This commit is contained in:
2024-06-17 13:37:47 +02:00
parent b73c4e4526
commit 1bd8d93ce5
4 changed files with 81 additions and 16 deletions

View File

@@ -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();
}
}