From c61fe55b4d875f7601025cc933afefa1d1de56db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 26 Mar 2021 19:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/SqlBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database/SqlBuilder.php b/Database/SqlBuilder.php index aefb8205..1004f939 100644 --- a/Database/SqlBuilder.php +++ b/Database/SqlBuilder.php @@ -294,10 +294,10 @@ class SqlBuilder extends Component public function tableName(): string { if ($this->query->from instanceof \Closure) { - $this->query->from = '(' . $this->query->makeClosureFunction($this->query->from) . ')'; + $this->query->from = $this->query->makeClosureFunction($this->query->from); } if ($this->query->from instanceof ActiveQuery) { - $this->query->from = '(' . SqlBuilder::builder($this->query->from)->get($this->query->from) . ')'; + $this->query->from = SqlBuilder::builder($this->query->from)->get($this->query->from); } if (empty($this->query->from)) { return $this->query->modelClass::getTable();