* Adjust code
This commit is contained in:
@@ -548,12 +548,12 @@ class searchModel extends model
|
||||
$trimedWord = trim($splitedWords['words']);
|
||||
$against .= '"' . $trimedWord . '" ';
|
||||
$againstCond .= '+"' . $trimedWord . '" ';
|
||||
if(is_numeric($word) and (strpos($word, '.') === false) and strlen($word) == 5) $againstCond .= "-\" $word \" ";
|
||||
if(is_numeric($word) and strpos($word, '.') === false and strlen($word) == 5) $againstCond .= "-\" $word \" ";
|
||||
|
||||
$likeWord = is_numeric($word) ? $word : $trimedWord;
|
||||
if(is_numeric($word) and (strpos($word, '.') === false) and strlen($word) < 5) $likeWord = str_pad("|$likeWord|", 5, '_');
|
||||
if(is_numeric($word) and strpos($word, '.') === false and strlen($word) < 5) $likeWord = str_pad("|$likeWord|", 5, '_');
|
||||
$condition = "OR title like '%{$likeWord}%' OR content like '%{$likeWord}%'";
|
||||
if(is_numeric($word) and (strpos($word, '.') === false) and strlen($word) == 5) $condition = "OR title REGEXP '[^ ]{$likeWord}[^ ]' OR content REGEXP '[^ ]{$likeWord}[^ ]'";
|
||||
if(is_numeric($word) and strpos($word, '.') === false and strlen($word) == 5) $condition = "OR title REGEXP '[^ ]{$likeWord}[^ ]' OR content REGEXP '[^ ]{$likeWord}[^ ]'";
|
||||
$likeCondition .= $condition;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user