This commit is contained in:
2023-04-10 17:39:36 +08:00
parent f8f22c39c4
commit a7d8ee83ee
+9
View File
@@ -261,7 +261,16 @@ class Model extends Base\Model
} }
$data[$key] = $this->{$method}($datum); $data[$key] = $this->{$method}($datum);
} }
return $this->withs($data);
}
/**
* @param $data
* @return array
*/
private function withs($data): array
{
$with = $this->getWith(); $with = $this->getWith();
foreach ($with as $value) { foreach ($with as $value) {
$join = $this->{'get' . ucfirst($value)}(); $join = $this->{'get' . ucfirst($value)}();