From 138dab1e9e5373fca4b41748360c936ce923fe05 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 23 Apr 2016 09:03:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=86=99=E5=85=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E5=8F=82=E6=95=B0=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index 9872c815..905a6905 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -100,8 +100,13 @@ abstract class Builder $result[$item] = 'NULL'; } elseif (is_scalar($val)) { // 过滤非标量数据 - $this->query->bind($key, $val, isset($bind[$key]) ? $bind[$key] : PDO::PARAM_STR); - $result[$item] = ':' . $key; + if ($this->query->isBind(substr($val, 1))) { + $result[$item] = $val; + } else { + $this->query->bind($key, $val, isset($bind[$key]) ? $bind[$key] : PDO::PARAM_STR); + $result[$item] = ':' . $key; + } + } } }