Ranking: Rank Number Column

This commit is contained in:
Torsten 2017-06-27 08:57:56 +02:00
parent c4973664b9
commit 92a07b1684
4 changed files with 37 additions and 2 deletions

View file

@ -65,6 +65,11 @@ class UsersController extends Controller
public function store() {
if (Auth::guest()) { return redirect("/"); }
$season_id = Season::getCurrent()->id;
@ -163,6 +168,12 @@ class UsersController extends Controller
usort($arr, array($this,"cmp"));
$users=$arr;
$rank=1;
foreach($users as $user) {
$user->rank =$rank;
$rank +=1;
}
$round=Round::where('id','=',$round_id)->first();
$games=Game::where('round_id','=',$round->id)->get();