This commit is contained in:
2024-12-13 14:34:06 +08:00
parent 450870ea19
commit 263f99c8c3
+1 -1
View File
@@ -401,7 +401,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
public function from(string|Closure $tableName): static public function from(string|Closure $tableName): static
{ {
if ($tableName instanceof Closure) { if ($tableName instanceof Closure) {
$this->from = call_user_func($tableName, $this->queryInstance()); $this->from = $this->makeClosureFunction($tableName);
} else if (class_exists($tableName)) { } else if (class_exists($tableName)) {
$this->from = (new $tableName)->getTable(); $this->from = (new $tableName)->getTable();
} else { } else {