mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-03 05:52:48 +08:00
改进model类order方法
添加json类型支持 支持json字段查询例如 $map['user$.name'] = 'thinkphp' escapeString方法采用PDO::quote方法
This commit is contained in:
@@ -94,4 +94,20 @@ class Pgsql extends Driver
|
||||
return $limitStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段和表名处理
|
||||
* @access protected
|
||||
* @param string $key
|
||||
* @return string
|
||||
*/
|
||||
protected function parseKey(&$key)
|
||||
{
|
||||
$key = trim($key);
|
||||
if (strpos($key, '$.') && false === strpos($key, '(')) {
|
||||
// JSON字段支持
|
||||
list($field, $name) = explode($key, '$.');
|
||||
$key = $field . '->>\'' . $name . '\'';
|
||||
}
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user