diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 26ab13cc..ced89e49 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -491,7 +491,7 @@ class Query if (is_string($field) && !empty($this->options['via'])) { $field = $this->options['via'] . '.' . $field; } - if (is_string($field) && strpos($field, ' ')) { + if (is_string($field) && preg_match('/[,=\>\<\'\"\(`.\s]/', $field)) { $where[] = ['exp', $field]; if (is_array($op)) { // 参数绑定