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;