model = new DecorateModel(); } /** * 获取页面 * @return void */ public function getPage(){ $id = input('id'); $data = $this->model->getPageData($id); if(!$data){ $this->error("获取页面配置失败"); } $this->success("获取成功",$data); } /** * 判断是否为默认主页 * @return void */ public function isIndex(){ $id = input('page_id'); $isIndex = $this->model->where([ 'type'=>'index', 'id'=>$id, 'default_page'=>1 ])->find(); if(!$isIndex){ $this->error("非主页"); } $this->success("主页"); } }