This commit is contained in:
2023-04-10 17:35:59 +08:00
parent fdf696624c
commit f8f22c39c4
+4
View File
@@ -11,6 +11,7 @@ namespace Database;
use Database\Base\Getter; use Database\Base\Getter;
use Database\Traits\HasBase;
use Exception; use Exception;
use Kiri; use Kiri;
use Kiri\Exception\NotFindClassException; use Kiri\Exception\NotFindClassException;
@@ -264,6 +265,9 @@ class Model extends Base\Model
$with = $this->getWith(); $with = $this->getWith();
foreach ($with as $value) { foreach ($with as $value) {
$join = $this->{'get' . ucfirst($value)}(); $join = $this->{'get' . ucfirst($value)}();
if ($join instanceof HasBase) {
$join = $join->get();
}
if ($join instanceof Kiri\ToArray) { if ($join instanceof Kiri\ToArray) {
$join = $join->toArray(); $join = $join->toArray();
} }