Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
51 | public static function setRank() |
||
52 | { |
||
53 | $totalPoints = self::getTotalPoints(); |
||
54 | $rankObj = DB::select("SELECT * FROM users WHERE total_points = $totalPoints ORDER BY TIMEDIFF(start, end) DESC;"); |
||
55 | |||
56 | for ($i = 0; $i < count($rankObj); $i++) { |
||
57 | DB::table('users')->where('name_gen', $rankObj[$i]->name_gen)->update(['rank' => (++$i)]); |
||
58 | $i--; |
||
59 | } |
||
62 |