From 7050d8b6301d49aea65dac81cf6ff4d908eea831 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 28 Apr 2016 15:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84Builder=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index e07e51e7..a3838499 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -228,7 +228,7 @@ abstract class Builder foreach ($where as $key => $val) { $str = []; foreach ($val as $field => $value) { - if (in_array($field, $fields, true) && is_scalar($value) && !$this->query->isBind($field)) { + if ($fields && in_array($field, $fields, true) && is_scalar($value) && !$this->query->isBind($field)) { $this->query->bind($field, $value, isset($binds[$field]) ? $binds[$field] : PDO::PARAM_STR); $value = ':' . $field; }