renderSuccess(compact('categoryList')); } /** * 文章列表 * @param int $category_id * @return array * @throws \think\exception\DbException */ public function lists($category_id = 0) { $model = new ArticleModel; $list = $model->getList($category_id); return $this->renderSuccess(compact('list')); } /** * 文章详情 * @param $article_id * @return array * @throws \app\common\exception\BaseException * @throws \think\Exception * @throws \think\exception\DbException */ public function detail($article_id) { $detail = ArticleModel::detail($article_id); return $this->renderSuccess(compact('detail')); } }