From b14f58d717411fbee8b24fbe647b239eeae7d4df Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 16 Oct 2017 17:22:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Balias=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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index b32bff90..6b85aba3 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1523,7 +1523,12 @@ class Query { if (is_array($alias)) { foreach ($alias as $key => $val) { - $this->options['alias'][$key] = $val; + if (false !== strpos($key, '__')) { + $table = $this->parseSqlTable($key); + } else { + $table = $key; + } + $this->options['alias'][$table] = $val; } } else { if (isset($this->options['table'])) {