@@ -4,10 +4,10 @@ |
||
| 4 | 4 | |
| 5 | 5 | class DescriptionController extends Controller |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
| 9 | - */ |
|
| 10 | - public function showDescription() |
|
| 7 | + /** |
|
| 8 | + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
| 9 | + */ |
|
| 10 | + public function showDescription() |
|
| 11 | 11 | { |
| 12 | 12 | return view('user.description'); |
| 13 | 13 | } |
@@ -22,10 +22,10 @@ |
||
| 22 | 22 | return view('leader.ranking', ['rankArray' => $rankArray, 'userRank' => $userRank]); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Rang wird berechnet und in DB zugewisen |
|
| 27 | - */ |
|
| 28 | - private function setRank() |
|
| 25 | + /** |
|
| 26 | + * Rang wird berechnet und in DB zugewisen |
|
| 27 | + */ |
|
| 28 | + private function setRank() |
|
| 29 | 29 | { |
| 30 | 30 | $totalPoints = CodeCount::getTotalPoints(); |
| 31 | 31 | $rankObj = DB::select('SELECT * FROM users WHERE total_points = '.$totalPoints.' ORDER BY TIMEDIFF(start, end) DESC;'); |
@@ -44,17 +44,17 @@ |
||
| 44 | 44 | return $totalPoints; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * |
|
| 49 | - */ |
|
| 50 | - public static function setRank() |
|
| 51 | - { |
|
| 52 | - $totalPoints = CodeCount::getTotalPoints(); |
|
| 53 | - $rankObj = DB::select('SELECT * FROM users WHERE total_points = '.$totalPoints.' ORDER BY TIMEDIFF(start, end) DESC;'); |
|
| 54 | - |
|
| 55 | - for ($i = 0; $i < count($rankObj); $i++) { |
|
| 56 | - DB::table('users')->where('name_gen', $rankObj[$i]->name_gen)->update(['rank' => (++$i)]); |
|
| 57 | - $i--; |
|
| 58 | - } |
|
| 59 | - } |
|
| 47 | + /** |
|
| 48 | + * |
|
| 49 | + */ |
|
| 50 | + public static function setRank() |
|
| 51 | + { |
|
| 52 | + $totalPoints = CodeCount::getTotalPoints(); |
|
| 53 | + $rankObj = DB::select('SELECT * FROM users WHERE total_points = '.$totalPoints.' ORDER BY TIMEDIFF(start, end) DESC;'); |
|
| 54 | + |
|
| 55 | + for ($i = 0; $i < count($rankObj); $i++) { |
|
| 56 | + DB::table('users')->where('name_gen', $rankObj[$i]->name_gen)->update(['rank' => (++$i)]); |
|
| 57 | + $i--; |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | 60 | } |