From 0c11ee29f3d302a3182686a5bad212c3288d928a Mon Sep 17 00:00:00 2001 From: molong Date: Sun, 5 Nov 2017 18:17:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Search.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index cdccbc53..08291196 100644 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -13,8 +13,13 @@ use app\common\controller\Front; class Search extends Front{ //文档搜索结果显示 - public function index(){ - $content = model('Document'); + public function index(\think\Request $request){ + $model = $request->param('model', 'article'); + + if (db('Model')->where('name', $model)->value('id')) { + return $this->error('无此模型!'); + } + $content = M($model); $map = $this->mapBuild(); $list = $content->where($map)->order('create_time desc')->paginate(10);