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