Skip to content

Commit

Permalink
调整
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Oct 28, 2024
1 parent 1190d83 commit 6d6ac98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/model/relation/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ protected function matchPivot(Model $result): array
if ('pivot' == $name) {
$pivot[$attr] = $val;
if (isset($bindAttr[$attr])) {
$attr = $bindAttr[$attr];
$result->$attr = $val;
} elseif (array_search($attr, $bindAttr)) {
$result->$attr = $val;
$attr = $bindAttr[$attr];
$result->setAttr($attr, $val);
} elseif (false !== array_search($attr, $bindAttr)) {
$result->setAttr($attr, $val);
}
unset($result->$key);
}
Expand Down

0 comments on commit 6d6ac98

Please sign in to comment.