Пример #1
0
 public function actionListComment()
 {
     $this->layout = '//layouts/column2';
     $idshop = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
     $vote_type = isset($_REQUEST['vote_type']) ? $_REQUEST['vote_type'] : '';
     $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
     $page = isset($_POST['p']) ? $_POST['p'] : 1;
     $num_per_page = Yii::app()->params->listshop_num_per_page;
     $total = WUserItem::getCountComment($vote_type, $idshop);
     //echo $total;exit();
     $pageInfo = WFunction::getPagerInfo($total, $page, $num_per_page);
     //var_dump($pageInfo); exit();
     $imagePath = Yii::app()->theme->baseUrl . "/images/";
     $page_wap = WFunction::web_pager($total, $pageInfo['cpage'], $num_per_page, Yii::app()->createUrl('wUserItem/listcomment', array('id' => $idshop, 'vote_type' => $vote_type)), $imagePath);
     $arrListComment = WUserItem::getListComment($vote_type, $idshop, $pageInfo['start'], $num_per_page);
     $arrShop = WUserItem::getDetailShop($idshop);
     $this->render('listcomment', array('arrComment' => $arrListComment, 'pageInfo' => $pageInfo, 'model' => $arrShop, 'type' => $type, 'vote_type' => $vote_type));
 }