mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
改进model类order方法
添加json类型支持 支持json字段查询例如 $map['user$.name'] = 'thinkphp' escapeString方法采用PDO::quote方法
This commit is contained in:
@@ -89,6 +89,11 @@ class Mysql extends Driver
|
||||
protected function parseKey(&$key)
|
||||
{
|
||||
$key = trim($key);
|
||||
if (strpos($key, '$.') && false === strpos($key, '(')) {
|
||||
// JSON字段支持
|
||||
list($field, $name) = explode($key, '$.');
|
||||
$key = 'jsn_extract(' . $field . ', \'$.\'.' . $name . ')';
|
||||
}
|
||||
if (!preg_match('/[,\'\"\*\(\)`.\s]/', $key)) {
|
||||
$key = '`' . $key . '`';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user