mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Relation类save方法
This commit is contained in:
@@ -554,7 +554,7 @@ class Relation
|
|||||||
case self::BELONGS_TO:
|
case self::BELONGS_TO:
|
||||||
case self::HAS_MANY:
|
case self::HAS_MANY:
|
||||||
if ($data instanceof Model) {
|
if ($data instanceof Model) {
|
||||||
$data = $data->toArray();
|
$data = $data->getData();
|
||||||
}
|
}
|
||||||
// 保存关联表数据
|
// 保存关联表数据
|
||||||
$data[$this->foreignKey] = $this->parent->{$this->localKey};
|
$data[$this->foreignKey] = $this->parent->{$this->localKey};
|
||||||
|
|||||||
Reference in New Issue
Block a user