(Update) UserController

Pull same stat as history (which is correct?)
This commit is contained in:
singularity43
2019-03-08 20:33:14 -05:00
parent 747ef534bd
commit eec7173d32
+2 -2
View File
@@ -108,9 +108,9 @@ class UserController extends Controller
$warnings = Warning::where('user_id', '=', $id)->whereNotNull('torrent')->where('active', '=', 1)->take(3)->get();
$hitrun = Warning::where('user_id', '=', $id)->latest()->paginate(10);
$bonupload = BonTransactions::where('sender', '=', $id)->where([['name', 'like', '%Upload%']])->sum('cost');
$realupload = $user->uploaded - $bonupload;
$realupload = $user->history->sum('uploaded') - $bonupload;
$bondownload = BonTransactions::where('sender', '=', $id)->where([['name', 'like', '%Download%']])->sum('cost');
$realdownload = $user->downloaded + $bondownload;
$realdownload = $user->history->sum('downloaded') - $bondownload;
$invitedBy = Invite::where('accepted_by', '=', $user->id)->first();
$requested = TorrentRequest::where('user_id', '=', $user->id)->count();