<?php 
class Member_vip_Model extends Model{
	function __construct(){
		parent::__construct();
		$this->db	=	new Database();
	}
	function getVipEnd(){
		return $this->db->orderby('vip_number_id','DESC')->get('member_vip')->current();
	}
	function getVipNumber($page=false,$showline=false){
		if($page===false){
			return $this->db->get('member_vip');
		}
		else{
			return $this->db->limit($showline,$page*$showline-$showline)->get('member_vip');
		}
	}
	function insertVipNumber($vip){
		return $this->db->insert('member_vip',$vip);
	}
	function deleteVip($arrid){
		return $this->db->in("vip_number_id",$arrid)->delete("member_vip");
	}
	function makeCard($arrid){
		return $this->db->in("vip_number_id",$arrid)->update("member_vip",array("vip_number_status"=>1));
	}
	function truncate(){
		return $this->db->query('truncate table '.DBFIX.'member_vip');
	}
}