diff --git a/library/think/db/builder/Mysql.php b/library/think/db/builder/Mysql.php index 7744be9a..a3e223ed 100644 --- a/library/think/db/builder/Mysql.php +++ b/library/think/db/builder/Mysql.php @@ -34,7 +34,7 @@ class Mysql extends Builder // JSON字段支持 list($field, $name) = explode('$.', $key); $key = 'json_extract(' . $field . ', \'$.' . $name . '\')'; - } elseif (strpos($key, '.')) { + } elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) { list($table, $key) = explode('.', $key, 2); if (isset($options['alias'][$table])) { $table = $options['alias'][$table];