修正EXP查询的参数绑定

This commit is contained in:
thinkphp
2016-09-13 17:17:01 +08:00
parent 3d868bc2d5
commit 79bdc2fd9a
2 changed files with 19 additions and 1 deletions

View File

@@ -297,7 +297,7 @@ abstract class Builder
}
}
$bindType = isset($binds[$field]) ? $binds[$field] : PDO::PARAM_STR;
if (is_scalar($value) && array_key_exists($field, $binds) && !in_array($exp, ['NOT NULL', 'NULL', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN']) && strpos($exp, 'TIME') === false) {
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))) {
$bindName = $bindName ?: 'where_' . $field;
$this->query->bind($bindName, $value, $bindType);