From 287b390c8ffbb738c5a85bb15058a02dd2b98056 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 13 Apr 2018 13:21:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Border=E7=94=A8=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 327d2b4c..35cad2ef 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1503,7 +1503,11 @@ class Query if (!empty($this->options['via'])) { $field = $this->options['via'] . '.' . $field; } - $field = empty($order) ? $field : [$field => $order]; + if (strpos($field, ',')) { + $field = array_map('trim', explode(',', $field)); + } else { + $field = empty($order) ? $field : [$field => $order]; + } } elseif (!empty($this->options['via'])) { foreach ($field as $key => $val) { if (is_numeric($key)) {