修正对象的条件查询

This commit is contained in:
thinkphp
2017-08-02 18:11:55 +08:00
parent 59dc931616
commit 372111c3a9

View File

@@ -335,6 +335,11 @@ abstract class Builder
$bindName = md5($bindName);
}
if (is_object($value) && method_exists($value, '__toString')) {
// 对象数据写入
$value = $value->__toString();
}
$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))) {