This commit is contained in:
2021-03-26 15:28:37 +08:00
parent c273aba792
commit 146ac4f3a1
+1 -1
View File
@@ -267,7 +267,7 @@ class SqlBuilder extends Component
if ($this->query->from instanceof \Closure) {
$activeQuery = new ActiveQuery($this->query->modelClass);
call_user_func($this->query->from, $activeQuery);
$this->query->from = $activeQuery->toSql();
$this->query->from = '(' . $activeQuery->toSql() . ')';
}
if ($this->query->from instanceof ActiveQuery) {
$this->query->from = '(' . SqlBuilder::builder($this->query->from)->get($this->query->from) . ')';