From 08e42118f625805729abe0161156038f31c6cbfe Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 5 Jun 2017 11:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=A4=9A=E5=AF=B9=E5=A4=9A?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model/relation/BelongsToMany.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/model/relation/BelongsToMany.php b/library/think/model/relation/BelongsToMany.php index ec0eb440..71ab4266 100644 --- a/library/think/model/relation/BelongsToMany.php +++ b/library/think/model/relation/BelongsToMany.php @@ -93,7 +93,7 @@ class BelongsToMany extends Relation } } } - $model->pivot = $this->newPivot($pivot); + $model->setRelation('pivot', $this->newPivot($pivot)); } } @@ -359,7 +359,7 @@ class BelongsToMany extends Relation } } } - $set->pivot = $this->newPivot($pivot); + $set->setRelation('pivot', $this->newPivot($pivot)); $data[$pivot[$this->localKey]][] = $set; } return $data;