예제 #1
0
 /**
  * 首页
  *
  */
 public function actionIndex()
 {
     parent::_acl();
     $model = new Position();
     $criteria = new CDbCriteria();
     $condition = '1';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     $pageParams = XUtils::buildCondition($_GET, array('type'));
     $pages->params = is_array($pageParams) ? $pageParams : array();
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('index', array('datalist' => $result, 'pagebar' => $pages));
 }