<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Pay_model extends MY_Model{

    public $table = 'pay';
    protected $insert_filed = array('key','appid','publickey');
    public function __construct()
    {
        parent::__construct();
    } 

    public function add($data)
    {
        $data =$this->check_insert($data);
        $this->db->insert($this->table, $data);
        return $this->db->insert_id();
    }

    public function get(){
        return $this->db->get($this->table)->row_array();
    }


    public function count()
    {
        return $this->db->count_all($this->table);
    }
    public function listInfo($limit,$offset)
    {
        return $this->db->get($this->table,$limit,$offset)->result_array();
    }

    public function keyInfo($data)
    {
        $this->db->where('appid',$data);
        return $this->db->get($this->table)->row_array();
    }
}