diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index a62f007..09ad2c9 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -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('文章不存在或已删除!'); }