时间:2021-07-01 10:21:17 帮助过:4人阅读
$sql='SELECT * FROM '.ParkRolePage::model()->tableName().' order by rolepage_id limit 0,5 '; //$model= ParkRolePage()::model(); $model=$this->db()->createCommand($sql)->queryAll(); $pages = new CPagination(ParkRolePage::model()->count()); $pages->pageSize=10; //die(); //if(isset($_GET['ParkRolePage'])) //$model->attributes=$_GET['ParkRolePage']; $this->controller->render('admin',array( 'model'=>$model, 'pages'=>$pages, ));
关系id | 角色id | 页面访问代码 | 操作选项 | ||
createUrl('/parkrolepage/view',array('id'=>$v['rolepage_id'])) ?>">查看 | createUrl('/parkrolepage/update',array('id'=>$v['rolepage_id']))?>">修改 | createUrl('/parkrolepage/delete',array('id'=>$v['rolepage_id']))?>">删除 | widget('CLinkPager', array( 'header'=>'翻页:', 'pages' => $pages, 'firstPageLabel'=>'首页', 'lastPageLabel' =>'末页', 'prevPageLabel'=>'前一页', 'nextPageLabel'=>'下一页', 'maxButtonCount'=>13 )) ?> |
$model=Yii::app()->db->createCommand($sql." LIMIT :offset,:limit"); $model->bindValue(':offset', $pages->currentPage*$pages->pageSize); $model->bindValue(':limit', $pages->pageSize); $model=$model->queryAll();