From 6690126429f6631af8885d03a8fa831184ab2ed5 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 19 Jan 2016 19:05:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=BB=91=E5=AE=9A=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=89=A7=E8=A1=8Csql=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Driver.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/think/db/Driver.php b/library/think/db/Driver.php index 64573625..ba68ad96 100644 --- a/library/think/db/Driver.php +++ b/library/think/db/Driver.php @@ -169,7 +169,9 @@ abstract class Driver $this->queryStr = $str; if (!empty($this->bind)) { $that = $this; - $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return $that->quote($val);}, $this->bind)); + $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) { + return $that->quote(is_array($val) ? $val[0] : $val); + }, $this->bind)); } if ($fetchSql) { return $this->queryStr; @@ -228,7 +230,9 @@ abstract class Driver $this->queryStr = $str; if (!empty($this->bind)) { $that = $this; - $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return $that->quote($val);}, $this->bind)); + $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) { + return $that->quote(is_array($val) ? $val[0] : $val); + }, $this->bind)); } if ($fetchSql) { return $this->queryStr;