request->request('aid'); $page = (int)$this->request->request('page'); Config::set('paginate.page', $page); $commentList = \addons\cms\model\Comment::getCommentList(['aid' => $aid]); $this->success('', ['commentList' => $commentList->getCollection()]); } /** * 发表评论 */ public function post() { try { $params = $this->request->post(); \addons\cms\model\Comment::postComment($params); } catch (Exception $e) { $this->error($e->getMessage(), null, ['token' => $this->request->token()]); } $this->success(__('评论成功')); } }