From 44e86a7f5359ce6e156bed64503a8a50dc1e1a1e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 24 May 2016 22:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=9A=84view?= =?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, 2 insertions(+), 2 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index bd1138ca..a5e042b8 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -662,11 +662,11 @@ class Query $fields = []; if (is_array($join)) { // 支持数据表别名 - list($join, $alias) = $join; + list($join, $alias, $table) = array_pad($join, 3, ''); } else { $alias = $join; } - $table = $this->getTable($join); + $table = !empty($table) ? $table : $this->getTable($join); if (is_string($field)) { $field = explode(',', $field); }