From 310775471a00f762bcf0ba6c2f92dd073dbb92cc Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 12 Nov 2016 11:11:18 +0800 Subject: [PATCH] =?UTF-8?q?table=E6=96=B9=E6=B3=95=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=96=B9=E5=BC=8F=E7=9A=84=E5=AD=90?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= 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 fdf9d623..5e7bf07d 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1050,7 +1050,10 @@ class Query public function table($table) { if (is_string($table)) { - if (strpos($table, ',')) { + if (strpos($table, ')')) { + // 子查询 + $table = $table; + } elseif (strpos($table, ',')) { $tables = explode(',', $table); $table = []; foreach ($tables as $item) {