From f98716d88f1ea8be68b425c0d5b1a7f772da9339 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 15 Aug 2022 10:53:56 +0800 Subject: [PATCH 1/2] * Add the xuan update sql to zentao.sql. --- db/zentao.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/zentao.sql b/db/zentao.sql index 19da8ba2b0..0521a0b66f 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -6209,6 +6209,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_chat` ( `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `pinnedMessages` text NOT NULL DEFAULT '', `mergedChats` text NOT NULL DEFAULT '', + `adminInvite` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `gid` (`gid`), KEY `name` (`name`), From 1e5558d38370d2b349653a8de5bd08f5ac57fcf6 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 15 Aug 2022 11:06:18 +0800 Subject: [PATCH 2/2] * adjust for search. --- module/search/model.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/search/model.php b/module/search/model.php index 4055974eb6..0c17675817 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -612,7 +612,7 @@ class searchModel extends model $likeCondition = ''; /* Assisted lookup by like condition when only one word. */ - if(count($words) == 1 and strpos($words[0], ' ') === false and !is_numeric($words[0])) $likeCondition = "OR title like '%{$words[0]}%' OR content like '%{$words[0]}%'"; + if(count($words) == 1 and strpos($words[0], ' ') === false and !is_numeric($words[0])) $likeCondition = "OR title like '%{$trimedWord}%' OR content like '%{$trimedWord}%'"; $words = str_replace('"', '', $against); $words = str_pad($words, 5, '_'); @@ -653,8 +653,7 @@ class searchModel extends model $typeCount = $this->dao->select("objectType, count(*) as objectCount") ->from(TABLE_SEARCHINDEX) - ->where("(MATCH(title,content) AGAINST('{$againstCond}' IN BOOLEAN MODE) >= 1 {$likeCondition})") - ->andWhere('vision')->eq($this->config->vision) + ->where('vision')->eq($this->config->vision) ->andWhere('objectType')->in($allowedObject) ->andWhere('addedDate')->le(helper::now()) ->groupBy('objectType')