From 976215f1b83265a4375b99ffc7be1ced3b19e3ae Mon Sep 17 00:00:00 2001 From: WeakSun Date: Sat, 18 Jun 2016 01:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3$dataSet=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E7=B4=A2=E5=BC=950=E5=AF=BC=E8=87=B4=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当$dataSet不包含索引0的时候,会抛出异常,如:$dataSet = [1=>[……],'str'=>[……],……]; --- library/think/db/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index fa191827..58cc07ab 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1610,7 +1610,7 @@ class Query { // 分析查询表达式 $options = $this->parseExpress(); - if (!is_array($dataSet[0])) { + if (!is_array(reset($dataSet))) { return false; } // 生成SQL语句