From 3797d67133841b9f5d642c7d1e19e627ba9adcdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=B0=8F=E6=99=8B=E5=95=A6?= <1540175452@qq.com> Date: Wed, 10 Mar 2021 22:55:08 +0800 Subject: [PATCH] update src/model/relation/BelongsToMany.php. --- src/model/relation/BelongsToMany.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/model/relation/BelongsToMany.php b/src/model/relation/BelongsToMany.php index 6b64d95..d68ef77 100644 --- a/src/model/relation/BelongsToMany.php +++ b/src/model/relation/BelongsToMany.php @@ -162,7 +162,8 @@ class BelongsToMany extends Relation ->select() ->setParent(clone $this->parent); - $this->hydratePivot($result); + // 这里有个bug,在懒加载关联模型的时候,模型里面的Pivot中间模型是没有数据的 + // $this->hydratePivot($result); return $result; } -- Gitee