mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-04 01:09:58 -05:00
(Revert) Torrent Controller ⏪
- needs refactoring
This commit is contained in:
@@ -208,7 +208,7 @@ class TorrentController extends Controller
|
||||
|
||||
$torrent = DB::table('torrents')->selectRaw('distinct(torrents.imdb),max(torrents.created_at) as screated_at,max(torrents.seeders) as sseeders,max(torrents.leechers) as sleechers,max(torrents.times_completed) as stimes_completed,max(torrents.name) as sname')->leftJoin('torrents as torrentsl', 'torrents.id', '=', 'torrentsl.id')->groupBy('torrents.imdb')->whereRaw('torrents.status = ? AND torrents.imdb != ?', [1, 0]);
|
||||
|
||||
$prelauncher = $torrent->orderBy($sorting, $order)->pluck('imdb')->toArray();
|
||||
$prelauncher = $torrent->orderBy('s'.$sorting, $order)->pluck('imdb')->toArray();
|
||||
|
||||
if (! is_array($prelauncher)) {
|
||||
$prelauncher = [];
|
||||
@@ -425,7 +425,10 @@ class TorrentController extends Controller
|
||||
}
|
||||
|
||||
if ($collection == 1) {
|
||||
$torrent = DB::table('torrents')->selectRaw('distinct(torrents.imdb),max(torrents.created_at) as screated_at,max(torrents.seeders) as sseeders,max(torrents.leechers) as sleechers,max(torrents.times_completed) as stimes_completed,max(torrents.name) as sname')->leftJoin('torrents as torrentsl', 'torrents.id', '=', 'torrentsl.id')->groupBy('torrents.imdb')->whereRaw('torrents.status = ? AND torrents.imdb != ?', [1, 0]);
|
||||
$torrent = DB::table('torrents')->selectRaw('distinct(torrents.imdb),max(torrents.created_at) as screated_at,max(torrents.seeders) as sseeders,max(torrents.leechers) as sleechers,max(torrents.times_completed) as stimes_completed,max(torrents.name) as sname')
|
||||
->leftJoin('torrents as torrentsl', 'torrents.id', '=', 'torrentsl.id')
|
||||
->groupBy('torrents.imdb')
|
||||
->whereRaw('torrents.status = ? AND torrents.imdb != ?', [1, 0]);
|
||||
|
||||
if ($request->has('search') && $request->input('search') != null) {
|
||||
$torrent->where(function ($query) use ($search) {
|
||||
@@ -650,7 +653,7 @@ class TorrentController extends Controller
|
||||
$logger = 'torrent.results_groupings';
|
||||
}
|
||||
|
||||
$prelauncher = $torrent->orderBy($sorting, $order)->pluck('imdb')->toArray();
|
||||
$prelauncher = $torrent->orderBy('s'.$sorting, $order)->pluck('imdb')->toArray();
|
||||
|
||||
if (! is_array($prelauncher)) {
|
||||
$prelauncher = [];
|
||||
|
||||
Reference in New Issue
Block a user