getDbConnection(); $dataCount = $connect->createCommand() ->from('exam_restore') ->where($where) ->query() ->count(); $result['totalCount']=$dataCount; $result['pageTotal']=ceil($dataCount/$pageLimit); $offset=($page-1)*$pageLimit; $data=$connect->createCommand() ->from('exam_restore') ->where($where) ->offset($offset) ->limit($pageLimit) ->order('create_time desc') ->query() ->readAll(); $result['data']=$data; return $result; } }