From e0d23618b6f358456b4e56bed729c076447bece4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 7 Dec 2016 11:18:04 +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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 1135a3d2..9f43f25a 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -469,6 +469,9 @@ class Query $key1 = array_shift($fields); $key2 = $fields ? array_shift($fields) : ''; $key = $key ?: $key1; + if (strpos($key, '.')) { + list($alias, $key) = explode('.', $key); + } foreach ($resultSet as $val) { if ($count > 2) { $result[$val[$key]] = $val;