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