diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index 77bb9794..16480d38 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -386,7 +386,7 @@ abstract class Builder $array[] = $key . ' ' . $exp . ' ' . $this->parseValue($item, $field); } $logic = isset($val[2]) ? $val[2] : 'AND'; - $whereStr .= '(' . implode($array, ' ' . strtoupper($logic) . ' ') . ')'; + $whereStr .= '(' . implode(' ' . strtoupper($logic) . ' ', $array) . ')'; } else { $whereStr .= $key . ' ' . $exp . ' ' . $this->parseValue($value, $field); }