@@ -73,14 +73,14 @@ |
||
| 73 | 73 | DB::update('UPDATE users SET total_points = ? WHERE name_gen = ?;', [$totalPoints, $name_gen]); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if(count($allPoints) == 1){ |
|
| 77 | - DB::table('users')->where('id',Auth::User()->id)->limit(1)->update(['start' => Carbon::now()->toDateTimeString()]); |
|
| 76 | + if (count($allPoints) == 1) { |
|
| 77 | + DB::table('users')->where('id', Auth::User()->id)->limit(1)->update(['start' => Carbon::now()->toDateTimeString()]); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $codeCount = CodeCount::getCodeCount(); |
| 81 | 81 | |
| 82 | - if(count($allPoints) == $codeCount){ |
|
| 83 | - DB::table('users')->where('id',Auth::User()->id)->update(['end' => Carbon::now()->toDateTimeString()]); |
|
| 82 | + if (count($allPoints) == $codeCount) { |
|
| 83 | + DB::table('users')->where('id', Auth::User()->id)->update(['end' => Carbon::now()->toDateTimeString()]); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | return view('leader.ranking', ['rankArray' => $rankArray, 'userRank' => $userRank]); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - private function setRank(){ |
|
| 23 | + private function setRank() { |
|
| 24 | 24 | DB::select('SELECT first_name,scoutname,last_name,rank,total_points,start,end FROM users WHERE total_points > 0 ORDER BY rank DESC, total_points DESC;'); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | return intval($codeCount); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public static function getCodeCount(){ |
|
| 24 | + public static function getCodeCount() { |
|
| 25 | 25 | $codeCount = DB::table('game_admin')->select('code_count')->first()->code_count; |
| 26 | 26 | |
| 27 | 27 | return $codeCount; |