Finalisation des vues de consultation et integration des liens entre jeux categories et genres
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
|
||||
class Game_model extends CI_Model {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->load->database();
|
||||
public function search_by_title($keyword) {
|
||||
|
||||
$this->db->like('name', $keyword);
|
||||
$query = $this->db->get('game');
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère les jeux appartenant à une catégorie spécifique
|
||||
@@ -68,11 +73,11 @@ class Game_model extends CI_Model {
|
||||
}
|
||||
|
||||
public function supprimer_jeu($id) {
|
||||
return $this->db->delete('game', array('id' => $id));
|
||||
return $this->db->delete('game', array('gameId' => $id));
|
||||
}
|
||||
|
||||
public function get_jeu($id) {
|
||||
$leJeu = $this->db->get_where('game', array('id' => $id));
|
||||
$leJeu = $this->db->get_where('game', array('gameId' => $id));
|
||||
return $leJeu->row_array();
|
||||
}
|
||||
|
||||
@@ -84,10 +89,20 @@ class Game_model extends CI_Model {
|
||||
'price' => empty($prix) ? NULL : $prix
|
||||
);
|
||||
|
||||
$this->db->where('id', $id);
|
||||
$this->db->where('gameId', $id);
|
||||
return $this->db->update('game', $donnees);
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user