From c061aac0e18136bb975aa63c0c8809edf6568210 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 28 Oct 2021 07:56:24 +0000 Subject: [PATCH] * Adjust code style --- module/search/model.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/search/model.php b/module/search/model.php index 6ff5cd09be..32e5939de1 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -132,14 +132,22 @@ class searchModel extends model $condition = ''; if($operator == "include") { - $condition = ' LIKE ' . $this->dbh->quote("%$value%"); + if($this->post->$fieldName == 'module') + { + $allModules = $this->loadModel('tree')->getAllChildId($value); + if($allModules) $condition = helper::dbIN($allModules); + } + else + { + $condition = ' LIKE ' . $this->dbh->quote("%$value%"); + } } elseif($operator == "notinclude") { if($this->post->$fieldName == 'module') { $allModules = $this->loadModel('tree')->getAllChildId($value); - if($allModules) $condition = " NOT IN ('" . join("','", $allModules) . "')"; + if($allModules) $condition = " NOT " . helper::dbIN($allModules); } else {