diff --git a/Model.php b/Model.php index e82a84f..66b7484 100644 --- a/Model.php +++ b/Model.php @@ -11,6 +11,7 @@ namespace Database; use Database\Base\Getter; +use Database\Traits\HasBase; use Exception; use Kiri; use Kiri\Exception\NotFindClassException; @@ -264,6 +265,9 @@ class Model extends Base\Model $with = $this->getWith(); foreach ($with as $value) { $join = $this->{'get' . ucfirst($value)}(); + if ($join instanceof HasBase) { + $join = $join->get(); + } if ($join instanceof Kiri\ToArray) { $join = $join->toArray(); }