mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-04 09:20:21 -05:00
(Update) UserController
Max not sum.
This commit is contained in:
@@ -1686,7 +1686,7 @@ class UserController extends Controller
|
||||
} elseif ($request->has('view') && $request->input('view') == 'history') {
|
||||
$history = History::with(['torrent' => function ($query) {
|
||||
$query->withAnyStatus();
|
||||
}])->selectRaw('distinct(history.id),max(history.info_hash) as info_hash,max(history.agent) as agent,sum(history.uploaded) as uploaded,sum(history.downloaded) as downloaded,max(history.seeder) as seeder,max(history.active) as active,sum(history.actual_uploaded) as actual_uploaded,sum(history.actual_downloaded) as actual_downloaded,sum(history.seedtime) as seedtime,max(history.created_at) as created_at,max(history.updated_at) as updated_at,max(history.completed_at) as completed_at,max(history.immune) as immune,max(history.hitrun) as hitrun,max(history.prewarn) as prewarn,max(torrents.moderated_at) as moderated_at,max(torrents.slug) as slug,max(torrents.user_id) as user_id,max(torrents.name) as name,max(torrents.category_id) as category_id,max(torrents.size) as size,max(torrents.leechers) as leechers,max(torrents.seeders) as seeders,max(torrents.times_completed) as times_completed,max(torrents.status) as status')->leftJoin('torrents', 'torrents.info_hash', '=', 'history.info_hash')->groupBy('history.id');
|
||||
}])->selectRaw('distinct(history.id),max(history.info_hash) as info_hash,max(history.agent) as agent,max(history.uploaded) as uploaded,max(history.downloaded) as downloaded,max(history.seeder) as seeder,max(history.active) as active,max(history.actual_uploaded) as actual_uploaded,max(history.actual_downloaded) as actual_downloaded,max(history.seedtime) as seedtime,max(history.created_at) as created_at,max(history.updated_at) as updated_at,max(history.completed_at) as completed_at,max(history.immune) as immune,max(history.hitrun) as hitrun,max(history.prewarn) as prewarn,max(torrents.moderated_at) as moderated_at,max(torrents.slug) as slug,max(torrents.user_id) as user_id,max(torrents.name) as name,max(torrents.category_id) as category_id,max(torrents.size) as size,max(torrents.leechers) as leechers,max(torrents.seeders) as seeders,max(torrents.times_completed) as times_completed,max(torrents.status) as status')->leftJoin('torrents', 'torrents.info_hash', '=', 'history.info_hash')->groupBy('history.id');
|
||||
|
||||
$order = null;
|
||||
$sorting = null;
|
||||
@@ -1897,7 +1897,7 @@ class UserController extends Controller
|
||||
$his_downl_cre = History::where('user_id', '=', $id)->sum('downloaded');
|
||||
$history = History::with(['torrent' => function ($query) {
|
||||
$query->withAnyStatus();
|
||||
}])->selectRaw('distinct(history.id),max(history.info_hash) as info_hash,max(history.agent) as agent,sum(history.uploaded) as uploaded,sum(history.downloaded) as downloaded,max(history.seeder) as seeder,max(history.active) as active,sum(history.actual_uploaded) as actual_uploaded,sum(history.actual_downloaded) as actual_downloaded,sum(history.seedtime) as seedtime,max(history.created_at) as created_at,max(history.updated_at) as updated_at,max(history.completed_at) as completed_at,max(history.immune) as immune,max(history.hitrun) as hitrun,max(history.prewarn) as prewarn,max(torrents.moderated_at) as moderated_at,max(torrents.slug) as slug,max(torrents.user_id) as user_id,max(torrents.name) as name,max(torrents.category_id) as category_id,max(torrents.size) as size,max(torrents.leechers) as leechers,max(torrents.seeders) as seeders,max(torrents.times_completed) as times_completed,max(torrents.status) as status')->leftJoin('torrents', 'torrents.info_hash', '=', 'history.info_hash')->where('history.user_id', '=', $user->id)->groupBy('history.id')
|
||||
}])->selectRaw('distinct(history.id),max(history.info_hash) as info_hash,max(history.agent) as agent,max(history.uploaded) as uploaded,max(history.downloaded) as downloaded,max(history.seeder) as seeder,max(history.active) as active,max(history.actual_uploaded) as actual_uploaded,max(history.actual_downloaded) as actual_downloaded,max(history.seedtime) as seedtime,max(history.created_at) as created_at,max(history.updated_at) as updated_at,max(history.completed_at) as completed_at,max(history.immune) as immune,max(history.hitrun) as hitrun,max(history.prewarn) as prewarn,max(torrents.moderated_at) as moderated_at,max(torrents.slug) as slug,max(torrents.user_id) as user_id,max(torrents.name) as name,max(torrents.category_id) as category_id,max(torrents.size) as size,max(torrents.leechers) as leechers,max(torrents.seeders) as seeders,max(torrents.times_completed) as times_completed,max(torrents.status) as status')->leftJoin('torrents', 'torrents.info_hash', '=', 'history.info_hash')->where('history.user_id', '=', $user->id)->groupBy('history.id')
|
||||
->orderBy('created_at', 'DESC')->paginate(50);
|
||||
|
||||
return view('user.private.torrents', [
|
||||
|
||||
Reference in New Issue
Block a user