public function index()
 {
     $bid = I('bid', 0);
     $modelPost = new PostViewModel();
     list($postList, $page, $postCount) = $modelPost->getList(0, $bid);
     if ($bid > 0) {
         $board = (new BoardModel())->find($bid);
         $this->assign('board', $board);
     }
     $this->assign('postList', $postList);
     $this->assign('page', $page);
     $this->assign('postCount', $postCount);
     $this->display();
 }
 public function index($id)
 {
     try {
         $model = new BoardModel();
         $modelPost = new PostViewModel();
         $board = $model->view($id, 1);
         list($postList, $page, $postCount) = $modelPost->getList(0, $id);
         $this->assign('board', $board);
         $this->assign('postList', $postList);
         $this->assign('page', $page);
         $this->assign('postCount', $postCount);
         $this->display();
     } catch (Exception $e) {
         $this->error($e->getMessage());
     }
 }
 /**
  * 用户帖子列表
  */
 public function posts()
 {
     $this->checkLogin();
     $model = new PostViewModel();
     list($list, $page, $count) = $model->getList($this->user['userId']);
     $this->assign('list', $list);
     $this->assign('page', $page);
     $this->assign('count', $count);
     $this->display();
 }