getDbConnection()->createCommand("select count(*) as count from assist_user where role=1")->queryRow(); $pages['total']=$totalQuery['count']; $pages['totalPage']=ceil($totalQuery['count']/$pageLimit); $pages['page']=$page; $data = $this->getDbConnection()->createCommand(" select user_id,user_name,real_name,sex,role,update_time,status,user_origin,cutting_limit,scan_limit from assist_user where role=1 order by user_id desc limit {$offset},{$pageLimit} ")->queryAll(); $return['pages']=$pages; $return['dataList']=$data; return $return; } public function getAllUser(){ $data = $this->getDbConnection()->createCommand(" select user_id,user_name,real_name,sex,role,update_time,status from assist_user where role=1 and status=1 order by user_id desc ")->queryAll(); return $data; } public function getAllUserByLimit($condition){ $sql="select user_id,user_name,real_name,sex,role,update_time,status from assist_user "; $where=array(); $where[]="role=1 "; $where[]="status=1 "; if($condition){ $where[]=$condition; } $sql.=" where ".implode(' and ',$where); $data = $this->getDbConnection()->createCommand($sql)->queryAll(); return $data; } }