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); }