$articleObj = new ArticleList();
$articleObj->where('id', $id)->where('is_draft', 0)->setInc('Click', 1);
//详情
if ($id > 12170) {//原来的文章不限制,新文章需要限制
$news = $articleObj->where('TypeId','<>',73)->where('is_draft', 0)->find(['id' => $id]);
} else {
$news = $articleObj->where('is_draft', 0)->find(['id' => $id]);
}
if (is_null($news)) {
throw new \think\exception\HttpException(404, '内容不存在!');
// return $this->error('内容不存在!');
}
$news = $news->toArray();
//查询所属菜单
$articleType = ArticleType::get(['id' => $news['TypeId']]);
$this->view->assign('news', $news);
$this->view->assign('articleType', $articleType);
$this->setSeo($news['SeoTitle'], $news['SeoKeywords'], $news['SeoDescription']);