Merge remote-tracking branch 'origin/main' into suite_sae
This commit is contained in:
@@ -93,16 +93,30 @@ class Game_model extends CI_Model {
|
||||
return $this->db->update('game', $donnees);
|
||||
}
|
||||
|
||||
public function get_tous_les_jeux($critere_tri = 'id') {
|
||||
$tris_autorises = array('id', 'name', 'releaseYear', 'price');
|
||||
|
||||
if (!in_array($critere_tri, $tris_autorises)) {
|
||||
$critere_tri = 'id';
|
||||
}
|
||||
|
||||
$this->db->order_by($critere_tri, 'ASC');
|
||||
|
||||
$query = $this->db->get('game');
|
||||
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
|
||||
public function search_by_title($keyword) {
|
||||
$this->db->select('*');
|
||||
$this->db->from('game');
|
||||
|
||||
$this->db->like('title', $keyword);
|
||||
|
||||
$query = $this->db->get();
|
||||
return $query->result_array();
|
||||
}
|
||||
$this->db->select('*');
|
||||
$this->db->from('game');
|
||||
|
||||
$this->db->like('title', $keyword);
|
||||
|
||||
$query = $this->db->get();
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user