改进模型数据验证

This commit is contained in:
thinkphp
2018-12-11 12:11:29 +08:00
parent d1a887cad7
commit e0c8c71190
4 changed files with 15 additions and 16 deletions

View File

@@ -202,10 +202,9 @@ class HasMany extends Relation
*/
public function save($data)
{
$model = $this->make();
$data = array_merge($model->getData(), $data);
$model = $this->make($data);
return $model->save($data) ? $model : false;
return $model->save() ? $model : false;
}
/**