count($criteria); $pager = new CPagination($total); if($condition) $criteria->condition = $condition; if($orderBy) $criteria->order = $orderBy; $pager->pageSize = 20; $pager->applyLimit($criteria); $data['result']=$this->findAll($criteria); $data['page']=$pager; $data['page_total']= $total; return $data; } // 根据id获取学期名称 public function getSemesterName($sid){ $info = $this->findByPk($sid); if (empty($info)) { return null; } else { return $info->semester_name; } } }