Skip to content

Commit d92420c

Browse files
authored
Merge pull request #69 from teamones-open/fix_schema
fixed: 数字和字符串处理顺序调整
2 parents bd1ab0e + 3db96da commit d92420c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/think/model/RelationModel.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,15 +2001,16 @@ private function parserFilterCustomItemCondition(&$filterData, $field, $conditio
20012001
if (is_array($condition)) {
20022002
list($itemCondition, $itemValue) = $condition;
20032003
if (in_array(strtolower($itemCondition), ['in', 'not in'])) {
2004-
if (is_array($itemValue)) {
2005-
$itemValue = join(',', $itemValue);
2006-
}
20072004

20082005
if (is_string($itemValue) && strpos($itemValue, "'") === false) {
20092006
// 字符串要加上 ''
20102007
$itemValue = "'{$itemValue}'";
20112008
}
20122009

2010+
if (is_array($itemValue)) {
2011+
$itemValue = join(',', $itemValue);
2012+
}
2013+
20132014
if (!empty($moduleCode)) {
20142015
$filterData["_string"] = "JSON_UNQUOTE( JSON_EXTRACT(`{$moduleCode}`.`json`, '$.{$field}' ) ) {$itemCondition} ({$itemValue})";
20152016
} else {

0 commit comments

Comments
 (0)