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) {