|
发表于 2015-10-14 11:21:15
|
显示全部楼层
if( !empty($sname) ) $this->db->where('sname',$sname);
if( !empty($start) ) $this->db->where('loginTime >',strtotime($start));
if( !empty($end) ) $this->db->where('loginTime <',strtotime($end." 23:59:59"));
|
PHP复制代码 $where = array();
$sname && $where['sname'] = $sname;
$start && $where['loginTime > '] = strtotime($start);
$end && $where['loginTime < '] = strtotime($end.'23:59:59');
$count = $this->db->where($where)->count_all_results();
$records = $this->db->where($where)->order_by('id', 'desc')->limit( 20);
复制代码
|
|