mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-02 21:41:36 +08:00
改进model类order方法
添加json类型支持 支持json字段查询例如 $map['user$.name'] = 'thinkphp' escapeString方法采用PDO::quote方法
This commit is contained in:
@@ -132,17 +132,6 @@ class Oracle extends Driver
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL指令安全过滤
|
||||
* @access public
|
||||
* @param string $str SQL指令
|
||||
* @return string
|
||||
*/
|
||||
public function escapeString($str)
|
||||
{
|
||||
return str_ireplace("'", "''", $str);
|
||||
}
|
||||
|
||||
/**
|
||||
* limit
|
||||
* @access public
|
||||
@@ -176,4 +165,21 @@ class Oracle extends Driver
|
||||
|
||||
return ' FOR UPDATE NOWAIT ';
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段和表名处理
|
||||
* @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