mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
Relation类save方法支持传入模型对象
This commit is contained in:
@@ -453,6 +453,9 @@ class Relation
|
||||
*/
|
||||
public function save($data, array $pivot = [])
|
||||
{
|
||||
if ($data instanceof Model) {
|
||||
$data = $data->toArray();
|
||||
}
|
||||
// 判断关联类型
|
||||
switch ($this->type) {
|
||||
case self::HAS_ONE:
|
||||
|
||||
Reference in New Issue
Block a user