Merge branch 'sprint224_zg_26307' into 'master'

* Fix bug #26307

See merge request easycorp/zentaopms!4931
This commit is contained in:
王怡栋
2022-08-12 00:31:55 +00:00
2 changed files with 5 additions and 12 deletions
+4 -11
View File
@@ -231,18 +231,11 @@ class search extends control
$pager = new pager(0, $this->config->search->recPerPage, $pageID);
$results = $this->search->getList($words, $type, $pager);
if($words)
$typeCount = $this->search->getListCount('');
$typeList = array('all' => $this->lang->search->modules['all']);
foreach($typeCount as $objectType => $count)
{
$typeCount = $this->search->getListCount($words);
$typeList = array('all' => $this->lang->search->modules['all']);
foreach($typeCount as $objectType => $count)
{
$typeList[$objectType] = $this->lang->search->modules[$objectType];
}
}
else
{
$typeList = $this->lang->search->modules;
$typeList[$objectType] = $this->lang->search->modules[$objectType];
}
/* Set session. */
+1 -1
View File
@@ -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) $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 '%{$words[0]}%' OR content like '%{$words[0]}%'";
$words = str_replace('"', '', $against);
$words = str_pad($words, 5, '_');