Skip to content

Commit b22e1a3

Browse files
authored
Merge pull request #4570 from Roardom/fix-bon-earnings-empty
(Fix) Bon earnings query duplicate column error when no earnings exist
2 parents 5011b8a + c262d80 commit b22e1a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/Http/Livewire/UserEarnings.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ final public function updatingSearch(): void
6969
#[Computed]
7070
final public function bonEarnings(): \Illuminate\Support\Collection
7171
{
72-
$outerQuery = DB::query();
72+
$outerQuery = DB::query()->select(DB::raw(1));
7373
$innerQuery = Peer::query()
74+
->select(DB::raw(1))
7475
->join('history', fn ($join) => $join->on('history.torrent_id', '=', 'peers.torrent_id')->on('history.user_id', '=', 'peers.user_id'))
7576
->join('torrents', 'peers.torrent_id', '=', 'torrents.id')
7677
->where('peers.seeder', '=', true)

0 commit comments

Comments
 (0)