(Update) UserController

Factor in bon.
This commit is contained in:
singularity43
2019-03-08 22:12:31 -05:00
parent f5663c4095
commit 2014f5706a
+6 -4
View File
@@ -107,14 +107,16 @@ class UserController extends Controller
$history = $user->history;
$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');
$hackupload = $user->history->sum('uploaded');
$hackdownload = $user->history->sum('downloaded');
$bonupload = BonTransactions::where('sender', '=', $id)->where([['name', 'like', '%Upload%']])->sum('cost');
$bondownload = BonTransactions::where('sender', '=', $id)->where([['name', 'like', '%Download%']])->sum('cost');
$hackupload = $user->history->sum('uploaded') + $bonupload;
$hackdownload = $user->history->sum('downloaded') + $bondownload;
$realupload = $hackupload - $bonupload;
$bondownload = BonTransactions::where('sender', '=', $id)->where([['name', 'like', '%Download%']])->sum('cost');
$realdownload = $hackdownload - $bondownload;
$invitedBy = Invite::where('accepted_by', '=', $user->id)->first();
$requested = TorrentRequest::where('user_id', '=', $user->id)->count();