mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进BelongsToMany关联查询
This commit is contained in:
@@ -162,7 +162,9 @@ class BelongsToMany extends Relation
|
|||||||
public function find($data = null)
|
public function find($data = null)
|
||||||
{
|
{
|
||||||
$result = $this->buildQuery()->find($data);
|
$result = $this->buildQuery()->find($data);
|
||||||
$this->hydratePivot([$result]);
|
if ($result) {
|
||||||
|
$this->hydratePivot([$result]);
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user