修正写入数据的参数绑定

This commit is contained in:
thinkphp
2016-04-23 09:03:41 +08:00
parent e4eaf89854
commit 138dab1e9e

View File

@@ -100,8 +100,13 @@ abstract class Builder
$result[$item] = 'NULL';
} elseif (is_scalar($val)) {
// 过滤非标量数据
$this->query->bind($key, $val, isset($bind[$key]) ? $bind[$key] : PDO::PARAM_STR);
$result[$item] = ':' . $key;
if ($this->query->isBind(substr($val, 1))) {
$result[$item] = $val;
} else {
$this->query->bind($key, $val, isset($bind[$key]) ? $bind[$key] : PDO::PARAM_STR);
$result[$item] = ':' . $key;
}
}
}
}