<commit_before><?php

/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2017/4/10
 * Time: 12:48
 */
class Affiche_Produit_Model extends CI_Model {

    public function __construct()
    {
        $this->load->database();
    }
    public function get_produit($slug = FALSE)
    {
        if ($slug === FALSE)
        {
            $query = $this->db->get('produits');
            return $query->result_array();
        }
        $query = $this->db->get_where('produits', array('slug' => $slug));
        return $query->row_array();
    }
    public function set_produits()
    {
        $this->load->helper('url');

        $data = array(
            'nom' => $this->input->post('nom'),
          //  'type' => $this->input->post('type'),
            'prix' => $this->input->post('prix'),
            'photo' => $this->input->post('photo')
        );

        return $this->db->insert('produits', $data);
    }

    public function get_unProduits($id)
    {
        //$query = $this->db->query('SELECT id,nom FROM produits);

    }
    public function supprimer_unProduits($id)
    {
        $query=$this->db->simple_query('DELETE FROM paniers WHERE paniers.produit_id = '.$id.'');
        $query=$this->db->simple_query('DELETE FROM produits WHERE id='.$id.'');
    }
}<commit_msg>实现了删除产品功能<commit_after><?php

/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2017/4/10
 * Time: 12:48
 */
class Affiche_Produit_Model extends CI_Model {

    public function __construct()
    {
        $this->load->database();
    }
    public function get_produit($slug = FALSE)
    {
        if ($slug === FALSE)
        {
            $query = $this->db->get('produits');
            return $query->result_array();
        }
        $query = $this->db->get_where('produits', array('slug' => $slug));
        return $query->row_array();
    }
    public function set_produits()
    {
        $this->load->helper('url');

        $data = array(
            'nom' => $this->input->post('nom'),
          //  'type' => $this->input->post('type'),
            'prix' => $this->input->post('prix'),
            'photo' => $this->input->post('photo')
        );

        return $this->db->insert('produits', $data);
    }

    public function get_unProduits($id)
    {
        //$query = $this->db->query('SELECT id,nom FROM produits);

    }
    public function supprimer_unProduits($id)
    {
        $this->db->simple_query('DELETE FROM paniers WHERE paniers.produit_id = '.$id.'');
        $this->db->simple_query('DELETE FROM produits WHERE id='.$id.'');
    }
}
{'fraction_non_alphanumeric': 0.18794048551292092, 'fraction_numerical': 0.008613938919342208, 'mean_word_length': 2.246505717916137, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3215589', 'n_tokens_mistral': 845, 'n_tokens_neox': 836, 'n_words': 148}