mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Merge branch 'master' of https://github.com/top-think/framework
This commit is contained in:
@@ -239,9 +239,11 @@ class BelongsToMany extends Relation
|
|||||||
$result = false;
|
$result = false;
|
||||||
foreach ($dataSet as $key => $data) {
|
foreach ($dataSet as $key => $data) {
|
||||||
if (!$samePivot) {
|
if (!$samePivot) {
|
||||||
$pivot = !empty($pivot) ? $pivot[$key] : [];
|
$pivotData = isset($pivot[$key]) ? $pivot[$key] : [];
|
||||||
|
} else {
|
||||||
|
$pivotData = $pivot;
|
||||||
}
|
}
|
||||||
$result = $this->attach($data, $pivot);
|
$result = $this->attach($data, $pivotData);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user