修正一个查询条件多个条件的时候的参数绑定BUG

This commit is contained in:
thinkphp
2016-09-17 00:05:26 +08:00
parent 8ff2e4fe5b
commit 9032818794

View File

@@ -300,6 +300,9 @@ abstract class Builder
$bindType = isset($binds[$field]) ? $binds[$field] : PDO::PARAM_STR;
if (is_scalar($value) && array_key_exists($field, $binds) && !in_array($exp, ['EXP', 'NOT NULL', 'NULL', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN']) && strpos($exp, 'TIME') === false) {
if (strpos($value, ':') !== 0 || !$this->query->isBind(substr($value, 1))) {
if ($this->query->isBind($bindName)) {
$bindName .= '_' . uniqid();
}
$this->query->bind($bindName, $value, $bindType);
$value = ':' . $bindName;
}