Finalisation des vues de consultation et integration des liens entre jeux categories et genres
This commit is contained in:
@@ -5,14 +5,23 @@ class Genre_model extends CI_Model {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->load->database();
|
||||
$this->load->database();
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère tous les genres de la base de données
|
||||
*/
|
||||
public function get_all() {
|
||||
$query = $this->db->get('genre');
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
public function get_by_game($game_id) {
|
||||
$this->db->select('genre.*');
|
||||
$this->db->from('genre');
|
||||
|
||||
$this->db->join('game_genre', 'game_genre.genreId = genre.genreId');
|
||||
|
||||
$this->db->where('game_genre.gameId', $game_id);
|
||||
|
||||
$query = $this->db->get();
|
||||
return $query->result_array();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user