You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
891 B
PHTML

3 years ago
<?php
namespace app\cms\home;
use app\cms\model\Page as PageModel;
/**
* 前台单页控制器
* @package app\cms\admin
*/
class Page extends Common
{
/**
* 单页详情
* @param null $id 单页id
* @author 蔡伟明 <314013107@qq.com>
* @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(); // 渲染模板
}
}