exam support priority + peer suppoert ipv4&ipv6

This commit is contained in:
xiaomlove
2022-04-18 19:07:35 +08:00
parent 107da8e335
commit 55138da862
46 changed files with 302 additions and 115 deletions
+7 -1
View File
@@ -193,7 +193,13 @@ class TorrentRepository extends BaseRepository
public function listPeers($torrentId)
{
$seederList = $leecherList = collect();
$peers = Peer::query()->where('torrent', $torrentId)->with(['user', 'relative_torrent'])->get()->groupBy('seeder');
$peers = Peer::query()
->where('torrent', $torrentId)
->groupBy('peer_id')
->with(['user', 'relative_torrent'])
->get()
->groupBy('seeder')
;
if ($peers->has(Peer::SEEDER_YES)) {
$seederList = $peers->get(Peer::SEEDER_YES)->sort(function ($a, $b) {
$x = $a->uploaded;