From b90b6a1ecb769316f69f86a1a98e4270e0604def Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 26 Oct 2018 16:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model/relation/BelongsToMany.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/think/model/relation/BelongsToMany.php b/library/think/model/relation/BelongsToMany.php index 28dc64c2..ab1d8dc1 100644 --- a/library/think/model/relation/BelongsToMany.php +++ b/library/think/model/relation/BelongsToMany.php @@ -522,14 +522,13 @@ class BelongsToMany extends Relation /** * 判断是否存在关联数据 * @access public - * @param mixed $data 数据 可以使用关联模型对象 或者 关联对象的主键 + * @param mixed $data 数据 可以使用关联模型对象 或者 关联对象的主键 * @return Pivot * @throws Exception */ public function attached($data) { if ($data instanceof Model) { - // 根据关联表主键直接写入中间表 $relationFk = $data->getPk(); $id = $data->$relationFk; } else {