* @return mixed * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function detail($id = null) { $info = PageModel::where('status', 1)->find($id); $info['url'] = url('cms/page/detail', ['id' => $info['id']]); $info['tags'] = explode(',', $info['keywords']); // 更新阅读量 PageModel::where('id', $id)->setInc('view'); $this->assign('page_info', $info); return $this->fetch(); // 渲染模板 } }