mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
修正查询条件为NULL的时候参数绑定的错误
This commit is contained in:
@@ -326,6 +326,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$value = date($format, $_SERVER['REQUEST_TIME']);
|
||||
break;
|
||||
case 'timestamp':
|
||||
case 'int':
|
||||
$value = $_SERVER['REQUEST_TIME'];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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, ['IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN']) && strpos($exp, 'TIME') === false) {
|
||||
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 (strpos($value, ':') !== 0 || !$this->query->isBind(substr($value, 1))) {
|
||||
$bindName = $bindName ?: 'where_' . $field;
|
||||
$this->query->bind($bindName, $value, $bindType);
|
||||
|
||||
Reference in New Issue
Block a user