MorphMany关联增加save和saveall方法

This commit is contained in:
thinkphp
2016-12-09 15:01:34 +08:00
parent c5dbbb45da
commit 308a0b9ca8
2 changed files with 36 additions and 2 deletions

View File

@@ -167,8 +167,7 @@ class HasMany extends Relation
{
$result = false;
foreach ($dataSet as $key => $data) {
$data[$this->foreignKey] = $this->parent->{$this->localKey};
$result = $this->save($data);
$result = $this->save($data);
}
return $result;
}