From 25981119addd8df005331bed208d41157d0af353 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 21 May 2016 10:24:08 +0800 Subject: [PATCH] =?UTF-8?q?Query=E7=B1=BB=E7=9A=84view=E6=96=B9=E6=B3=95fi?= =?UTF-8?q?eld=E5=8F=82=E6=95=B0=E6=94=AF=E6=8C=81=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index d481f7c5..0d09d17b 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -635,7 +635,7 @@ class Query * 指定JOIN查询字段 * @access public * @param string|array $table 数据表 - * @param array $field 查询字段 + * @param string|array $field 查询字段 * @param string|array $on JOIN条件 * @param string $type JOIN类型 * @return $this @@ -650,6 +650,9 @@ class Query } else { $fields = []; $table = $this->getTable($join); + if (is_string($field)) { + $field = explode(',', $field); + } foreach ($field as $key => $val) { if (is_numeric($key)) { $fields[] = $join . '.' . $val;