Skip to content

Commit bd1ab0e

Browse files
authored
Merge pull request #68 from teamones-open/fix_schema
fixed: 原生查询 字符串要加上 ''
2 parents ea12261 + 549e5e6 commit bd1ab0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/think/model/RelationModel.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,11 @@ private function parserFilterCustomItemCondition(&$filterData, $field, $conditio
20052005
$itemValue = join(',', $itemValue);
20062006
}
20072007

2008+
if (is_string($itemValue) && strpos($itemValue, "'") === false) {
2009+
// 字符串要加上 ''
2010+
$itemValue = "'{$itemValue}'";
2011+
}
2012+
20082013
if (!empty($moduleCode)) {
20092014
$filterData["_string"] = "JSON_UNQUOTE( JSON_EXTRACT(`{$moduleCode}`.`json`, '$.{$field}' ) ) {$itemCondition} ({$itemValue})";
20102015
} else {

0 commit comments

Comments
 (0)