getCommandBuilder()->createSqlCommand($countSql)->queryRow(); $result=array( 'total'=>$countData['count'], 'pageTotal'=>ceil($countData['count']/$pageLimit), 'page'=>$page ); $offset=($page-1)*$pageLimit; $sql.=" order by exam_group_id asc,class_id asc limit ".$offset.",".$pageLimit; $data=$countData=$this->getCommandBuilder()->createSqlCommand($sql)->queryAll(); $result['dataList']=$data; return $result; } }