From 05e341a80d300dc809d009393d975bca41e48c10 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 29 Oct 2016 09:24:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=9A=84join?= =?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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 0c9d8ef7..0cc522d5 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -677,7 +677,10 @@ class Query $this->alias($table); } elseif (strpos($join, ' ') && !strpos($join, ')')) { list($table, $alias) = explode(' ', $join); - $table = [$table => $alias]; + if (false === strpos($table, '.') && 0 !== strpos($table, $prefix) && 0 !== strpos($join, '__')) { + $table = $this->getTable($table); + } + $table = [$table => $alias]; $this->alias($table); } else { $table = $join;