修正mysql的json类型字段查询

This commit is contained in:
thinkphp
2016-09-26 17:53:16 +08:00
parent 8f26a8803f
commit 7a27dafae4

View File

@@ -32,7 +32,7 @@ class Mysql extends Builder
if (strpos($key, '$.') && false === strpos($key, '(')) {
// JSON字段支持
list($field, $name) = explode('$.', $key);
$key = 'jsn_extract(' . $field . ', \'$.\'.' . $name . ')';
$key = 'json_extract(' . $field . ', \'$.' . $name . '\')';
}
if (!preg_match('/[,\'\"\*\(\)`.\s]/', $key)) {
$key = '`' . $key . '`';