mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22: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']);
|
$value = date($format, $_SERVER['REQUEST_TIME']);
|
||||||
break;
|
break;
|
||||||
case 'timestamp':
|
case 'timestamp':
|
||||||
|
case 'int':
|
||||||
$value = $_SERVER['REQUEST_TIME'];
|
$value = $_SERVER['REQUEST_TIME'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ abstract class Builder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$bindType = isset($binds[$field]) ? $binds[$field] : PDO::PARAM_STR;
|
$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))) {
|
if (strpos($value, ':') !== 0 || !$this->query->isBind(substr($value, 1))) {
|
||||||
$bindName = $bindName ?: 'where_' . $field;
|
$bindName = $bindName ?: 'where_' . $field;
|
||||||
$this->query->bind($bindName, $value, $bindType);
|
$this->query->bind($bindName, $value, $bindType);
|
||||||
|
|||||||
Reference in New Issue
Block a user