From c36bcf6bab5a4bc1d198b433d68cfc580fbf035b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 20 Mar 2017 15:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=9A=84column?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 1534bf72..f0f0ec39 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -451,7 +451,9 @@ class Query if (isset($this->options['field'])) { unset($this->options['field']); } - if ($key && '*' != $field) { + if (is_null($field)) { + $field = '*'; + } elseif ($key && '*' != $field) { $field = $key . ',' . $field; } $pdo = $this->field($field)->getPdo();