From e2a77ff2f3b0291da202a2969ed4a59ca9a9f68d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 18 Dec 2017 16:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bjoin=E5=85=B3=E8=81=94?= =?UTF-8?q?=E8=87=AA=E8=BA=AB=E7=9A=84=E9=97=AE=E9=A2=98?= 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 78f971cb..9a274fd5 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -733,7 +733,10 @@ class Query if (isset($alias) && $table != $alias) { if (isset($this->options['alias'][$table])) { $table = $table . '@think' . uniqid(); + } elseif ($this->gettable() == $table) { + $table = $table . '@think' . uniqid(); } + $table = [$table => $alias]; $this->alias($table); }