mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-22 01:38:49 -05:00
fix: Profile, optimize SQL query for uploads count
This commit is contained in:
@@ -56,7 +56,10 @@ class UserController extends Controller
|
||||
|
||||
$groups = Group::all();
|
||||
$followers = Follow::where('target_id', '=', $user->id)->latest()->limit(25)->get();
|
||||
|
||||
$uploaded = Torrent::where('user_id', '=', $user->id)->count();
|
||||
$history = $user->history;
|
||||
|
||||
$warnings = Warning::where('user_id', '=', $user->id)->whereNotNull('torrent')->where('active', '=', 1)->take(\config('hitrun.max_warnings'))->get();
|
||||
$hitrun = Warning::where('user_id', '=', $user->id)->latest()->paginate(10);
|
||||
|
||||
@@ -82,6 +85,7 @@ class UserController extends Controller
|
||||
'user' => $user,
|
||||
'groups' => $groups,
|
||||
'followers' => $followers,
|
||||
'uploaded' => $uploaded,
|
||||
'history' => $history,
|
||||
'warnings' => $warnings,
|
||||
'hitrun' => $hitrun,
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
<div class="text-center">
|
||||
<span class="badge-user badge-float p-10"><i
|
||||
class="{{ config('other.font-awesome') }} fa-upload"></i> @lang('user.total-uploads')
|
||||
: <span class="text-green text-bold">{{ $user->torrents->count() }}</span></span>
|
||||
: <span class="text-green text-bold">{{ $uploaded }}</span></span>
|
||||
<span class="badge-user badge-float p-10"><i
|
||||
class="{{ config('other.font-awesome') }} fa-download"></i> @lang('user.total-downloads')
|
||||
: <span class="text-red text-bold">{{ $history->where('actual_downloaded', '>', 0)->count() }}</span></span>
|
||||
|
||||
Reference in New Issue
Block a user