CI框架数据库构造器or_where

public function index(){
	    
	    //查询优惠券
	    $weishiyong = $this->db->select('*')->get_where("imt_member_couponslog",array('uid'=>$this->uid,'status'=>1))->result_array();
	    $yishiyong = $this->db->select('*')->get_where("imt_member_couponslog",array('uid'=>$this->uid,'status'=>0))->result_array();
	    $yiguoqi = $this->db->where('uid',$this->uid)->or_where('start_time>',time())->or_where('end_time<',time())->get('imt_member_couponslog')->result_array();
	    
	    $this->template->assign(array(
            'weishiyong' => $weishiyong,
            'yishiyong' => $yishiyong,
            'yiguoqi' => $yiguoqi,
        ));
	    $this->template->display('coupons_index.html');
	}
"SELECT * FROM `imt_member_couponslog` WHERE `uid` = 5 OR `start_time` > 1548314715 OR `end_time` < 1548314715"

 

CI框架数据库构造器or_where

发表评论

电子邮件地址不会被公开。 必填项已用*标注

滚动到顶部