修正 使用参数绑定的时候返回执行sql的BUG

This commit is contained in:
thinkphp
2016-01-19 19:05:13 +08:00
parent 43718894fb
commit 6690126429

View File

@@ -169,7 +169,9 @@ abstract class Driver
$this->queryStr = $str;
if (!empty($this->bind)) {
$that = $this;
$this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return $that->quote($val);}, $this->bind));
$this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {
return $that->quote(is_array($val) ? $val[0] : $val);
}, $this->bind));
}
if ($fetchSql) {
return $this->queryStr;
@@ -228,7 +230,9 @@ abstract class Driver
$this->queryStr = $str;
if (!empty($this->bind)) {
$that = $this;
$this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return $that->quote($val);}, $this->bind));
$this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {
return $that->quote(is_array($val) ? $val[0] : $val);
}, $this->bind));
}
if ($fetchSql) {
return $this->queryStr;