mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
参数自动绑定采用数字key 避免sqlsrv不支持的情况
This commit is contained in:
@@ -329,8 +329,8 @@ abstract class Driver {
|
|||||||
if(0===strpos($val,':')){
|
if(0===strpos($val,':')){
|
||||||
$set[] = $this->parseKey($key).'='.$this->parseValue($val);
|
$set[] = $this->parseKey($key).'='.$this->parseValue($val);
|
||||||
}else{
|
}else{
|
||||||
$name = md5($key);
|
$name = count($this->bind);
|
||||||
$set[] = $this->parseKey($key).'=:T'.$name;
|
$set[] = $this->parseKey($key).'=:'.$name;
|
||||||
$this->bindParam($name,$val);
|
$this->bindParam($name,$val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -346,7 +346,7 @@ abstract class Driver {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function bindParam($name,$value){
|
protected function bindParam($name,$value){
|
||||||
$this->bind[':T'.$name] = $value;
|
$this->bind[':'.$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -747,8 +747,8 @@ abstract class Driver {
|
|||||||
if(0===strpos($val,':')){
|
if(0===strpos($val,':')){
|
||||||
$values[] = $this->parseValue($val);
|
$values[] = $this->parseValue($val);
|
||||||
}else{
|
}else{
|
||||||
$name = md5($key);
|
$name = count($this->bind);
|
||||||
$values[] = ':T'.$name;
|
$values[] = ':'.$name;
|
||||||
$this->bindParam($name,$val);
|
$this->bindParam($name,$val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user