refactor: code quality changes

This commit is contained in:
HDVinnie
2020-06-02 18:37:19 -04:00
parent 53fd6412b1
commit f69ecec866
25 changed files with 98 additions and 81 deletions
+8 -10
View File
@@ -1418,17 +1418,15 @@ class UserController extends Controller
if ($sorting != 'name' && $sorting != 'satisfied_at' && $sorting != 'size' && $sorting != 'times_completed' && $sorting != 'seeders' && $sorting != 'leechers') {
$table = $history->where('history.user_id', '=', $user->id)->orderBy($sorting, $order)->paginate(50);
} else {
if ($sorting == 'satisfied_at') {
if ($order == 'desc') {
$order = 'asc';
} elseif ($order == 'asc') {
$order = 'desc';
}
$table = $history->where('history.user_id', '=', $user->id)->orderBy($sorting, $order)->paginate(50);
} else {
$table = $history->where('history.user_id', '=', $user->id)->orderBy($sorting, $order)->paginate(50);
} elseif ($sorting == 'satisfied_at') {
if ($order == 'desc') {
$order = 'asc';
} elseif ($order == 'asc') {
$order = 'desc';
}
$table = $history->where('history.user_id', '=', $user->id)->orderBy($sorting, $order)->paginate(50);
} else {
$table = $history->where('history.user_id', '=', $user->id)->orderBy($sorting, $order)->paginate(50);
}
return view('user.filters.unsatisfieds', [