From 2f892770c258a2b792556be0e73f65c1c7b487d3 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 26 Nov 2016 23:14:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bsql=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=9A=84sql=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/db/Connection.php b/library/think/db/Connection.php index 9806b827..d9b7978f 100644 --- a/library/think/db/Connection.php +++ b/library/think/db/Connection.php @@ -421,8 +421,8 @@ abstract class Connection $type = is_array($val) ? $val[1] : PDO::PARAM_STR; if (PDO::PARAM_STR == $type) { $value = $this->quote($value); - } elseif (PDO::PARAM_INT == $type && '' === $value) { - $value = 0; + } elseif (PDO::PARAM_INT == $type) { + $value = (float) $value; } // 判断占位符 $sql = is_numeric($key) ?