Skip to content

Commit

Permalink
ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed May 3, 2024
1 parent 455eebe commit 02622dc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Entries/EntryQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,9 @@ private function ensureCollectionsAreQueriedForStatusQuery(): void
$ids = $wheres->where('column', 'id')->flatMap(fn ($where) => $where['values'] ?? [$where['value']]);

// If no IDs were queried, fall back to all collections.
if ($ids->isEmpty()) {
return $this->whereIn('collection', Collection::handles());
}

$this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values());
$ids->isEmpty()
? $this->whereIn('collection', Collection::handles())
: $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values());
}

private function getCollectionsForStatusQuery(): \Illuminate\Support\Collection
Expand Down

0 comments on commit 02622dc

Please sign in to comment.