Skip to content

Commit

Permalink
修复非一对多检索情况下重复添加查询条件的问题 (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick authored Sep 12, 2024
1 parent cd419b8 commit f0d58c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ parameters:
- identifier: missingType.generics
- '#Access to an undefined property (.*?)::\$pivot#'
- '#Parameter \#1 \$(.*?) of function array_pop expects array, array<int, string>\|false given.#'
- '#Cannot call method listen\(\) on Illuminate\\Contracts\\Events\\Dispatcher\|null.#'
2 changes: 2 additions & 0 deletions src/Relations/BelongsToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function addConstraints(): void
{
if (! $this->isOneOfMany()) {
parent::addConstraints();

return;
}

if (static::$constraints) {
Expand Down
2 changes: 2 additions & 0 deletions src/Relations/MorphToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function addConstraints(): void
{
if (! $this->isOneOfMany()) {
parent::addConstraints();

return;
}

if (static::$constraints) {
Expand Down

0 comments on commit f0d58c1

Please sign in to comment.