From 84ad4aadbff618da4b37b096bf5195bcbca4809d Mon Sep 17 00:00:00 2001 From: liyukun <1099438829@qq.com> Date: Sun, 10 Apr 2022 10:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Article.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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('文章不存在或已删除!'); }