This commit is contained in:
liyukun 2022-04-10 10:33:26 +08:00
parent 01785b105e
commit 84ad4aadbf
1 changed files with 1 additions and 5 deletions

View File

@ -118,11 +118,7 @@ class Article extends Base
}
//获取该文章
$documentModel = new Document();
if (is_int($id)){
$article = $documentModel->where('status', 1)->where('id', $id)->find();
}else{
$article = $documentModel->where('status', 1)->where('alias', $id)->find();
}
$article = $documentModel->where('status', 1)->where('id|alias', $id)->find();
if (!$article) {
$this->error('文章不存在或已删除!');
}