<?php
/**
	by it308.com
*/
class Email_m extends CI_Model{
	public function __construct(){
		parent::__construct();
	}
	public function insert($data){
		$this->db->insert('email',$data);
		//return $this->db->affected_rows();
		return $this->db->insert_id();
	}
	public function get($where){
		$this->db->where($where);
		$res = $this->db->get('email')->result();
		//echo $this->db->last_query();
		return $res;
	}
	public function delete($where){
		$this->db->where($where);
		$this->db->delete('email');
		return $this->db->affected_rows();
	}
	public function update($where,$data){
		$this->db->where($where);
		$this->db->update('email',$data);
		return $this->db->affected_rows();
	}
	public function getLimit($where="", $begin=0, $count=0){
		$this->db->where($where);
		$this->db->order_by('time desc');
		$this->db->limit($count,$begin);
		return  $this->db->get('email')->result();
	}
}