mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
预载入关联属性的默认规则
This commit is contained in:
@@ -126,7 +126,7 @@ class MorphTo extends Relation
|
||||
if (!isset($data[$result->$morphKey])) {
|
||||
$data[$result->$morphKey] = [];
|
||||
}
|
||||
$result->setAttr($relation, $this->resultSetBuild($data[$result->$morphKey], $class));
|
||||
$result->setAttr(Loader::parseName($relation), $this->resultSetBuild($data[$result->$morphKey], $class));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ class MorphTo extends Relation
|
||||
if ($data) {
|
||||
$data->isUpdate(true);
|
||||
}
|
||||
$result->setAttr($relation, $data ?: null);
|
||||
$result->setAttr(Loader::parseName($relation), $data ?: null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user