From 92be99e35f3e0cfb117a39924d32add2f2175674 Mon Sep 17 00:00:00 2001 From: huangdijia Date: Tue, 22 Dec 2015 13:32:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=A4=E5=A4=84warn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/driver/mongo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/db/driver/mongo.php b/library/think/db/driver/mongo.php index 7efd1002..1cc52cc0 100644 --- a/library/think/db/driver/mongo.php +++ b/library/think/db/driver/mongo.php @@ -483,9 +483,9 @@ class Mongo extends Driver } $this->model = $options['model']; $this->queryTimes++; - $query = $this->parseWhere($options['where']); - $fields = $this->parseField($options['field']); - if ($this->config['debug']) { + $query = $this->parseWhere(!empty($options['where'])?$options['where']:''); + $fields = $this->parseField(!empty($options['field'])?$options['field']:''); + if (!empty($this->config['debug'])) { $this->queryStr = $this->_dbName . '.' . $this->_collectionName . '.findOne('; $this->queryStr .= $query ? json_encode($query) : '{}'; $this->queryStr .= $fields ? ',' . json_encode($fields) : '';