@@ -78,7 +78,7 @@ |
||
| 78 | 78 | $mid = floor(($right + $left)/2); |
| 79 | 79 | if($this->getSeed($mid) < $rank){ |
| 80 | 80 | $right = $mid; |
| 81 | - }else{ |
|
| 81 | + } else{ |
|
| 82 | 82 | $left = $mid; |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | $mid = floor(($right + $left)/2); |
| 79 | 79 | if($this->getSeed($mid) < $rank){ |
| 80 | 80 | $right = $mid; |
| 81 | - }else{ |
|
| 81 | + } else{ |
|
| 82 | 82 | $left = $mid; |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | if($groupModel->judgeClearance($groupModel->gid($request->gcode), Auth::user()->id)>=2){ |
| 25 | 25 | return $next($request); |
| 26 | 26 | } |
| 27 | - }elseif(isset($request->cid)) { |
|
| 27 | + } elseif(isset($request->cid)) { |
|
| 28 | 28 | //contest privilege |
| 29 | 29 | $contestModel=new ContestModel(); |
| 30 | 30 | if($contestModel->judgeClearance($request->cid, Auth::user()->id)==3){ |
@@ -65,20 +65,26 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public static function getColor($rankTitle) |
| 67 | 67 | { |
| 68 | - if(is_null($rankTitle)) return ""; |
|
| 68 | + if(is_null($rankTitle)) { |
|
| 69 | + return ""; |
|
| 70 | + } |
|
| 69 | 71 | return self::$casualRanking[$rankTitle]; |
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | public static function getProfessionalColor($rankTitle) |
| 73 | 75 | { |
| 74 | - if(is_null($rankTitle)) return self::$professionalRanking["None"]; |
|
| 76 | + if(is_null($rankTitle)) { |
|
| 77 | + return self::$professionalRanking["None"]; |
|
| 78 | + } |
|
| 75 | 79 | return self::$professionalRanking[$rankTitle]; |
| 76 | 80 | } |
| 77 | 81 | |
| 78 | 82 | public function list($num) |
| 79 | 83 | { |
| 80 | 84 | $rankList=Cache::tags(['rank'])->get('general'); |
| 81 | - if($rankList==null) $rankList=[]; |
|
| 85 | + if($rankList==null) { |
|
| 86 | + $rankList=[]; |
|
| 87 | + } |
|
| 82 | 88 | $rankList=array_slice($rankList,0,$num); |
| 83 | 89 | $userInfoRaw=DB::table("users")->select("id as uid","avatar","name")->get()->all(); |
| 84 | 90 | $userInfo=[]; |
@@ -168,7 +174,9 @@ discard block |
||
| 168 | 174 | public function getRankTitle($rankVal) |
| 169 | 175 | { |
| 170 | 176 | foreach($this->casualRankingPer as $title=>$c){ |
| 171 | - if($rankVal<=$c) return $title; |
|
| 177 | + if($rankVal<=$c) { |
|
| 178 | + return $title; |
|
| 179 | + } |
|
| 172 | 180 | } |
| 173 | 181 | return Arr::last($this->casualRankingPer); |
| 174 | 182 | } |
@@ -176,7 +184,9 @@ discard block |
||
| 176 | 184 | public static function getProfessionalTitle($rankVal) |
| 177 | 185 | { |
| 178 | 186 | foreach(self::$professionalRankingPer as $title=>$point) { |
| 179 | - if($rankVal >= $point) return $title; |
|
| 187 | + if($rankVal >= $point) { |
|
| 188 | + return $title; |
|
| 189 | + } |
|
| 180 | 190 | } |
| 181 | 191 | return Arr::last(self::$professionalRankingPer); |
| 182 | 192 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | } |
| 44 | 44 | $result = $model->search($key); |
| 45 | 45 | $all_result[$name] = $result; |
| 46 | - }else{ |
|
| 46 | + } else{ |
|
| 47 | 47 | $all_result[$name] = [ |
| 48 | 48 | 'code' => -1, |
| 49 | 49 | 'msg' => 'cannot find class named '.$model_class |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | "name"=>$versionInfo[0]["name"], |
| 25 | 25 | "updatable"=>$updatable |
| 26 | 26 | ]; |
| 27 | - }catch(Throwable $e){ |
|
| 27 | + } catch(Throwable $e){ |
|
| 28 | 28 | return null; |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | //writing database |
| 39 | 39 | $this->transactionDB(); |
| 40 | 40 | |
| 41 | - }catch(Throwable $e){ |
|
| 41 | + } catch(Throwable $e){ |
|
| 42 | 42 | if ($e->getMessage()!==""){ |
| 43 | 43 | $this->command->line("\n <bg=red;fg=white> {$e->getMessage()} </>\n"); |
| 44 | 44 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | DB::commit(); |
| 222 | 222 | |
| 223 | - }catch(Throwable $e){ |
|
| 223 | + } catch(Throwable $e){ |
|
| 224 | 224 | DB::rollback(); |
| 225 | 225 | if ($e->getMessage()!=="") { |
| 226 | 226 | $this->command->line("\n <bg=red;fg=white> {$e->getMessage()} </>\n"); |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | $account=$contestModel->getContestAccount($cid); |
| 59 | 59 | if($account==null){ |
| 60 | 60 | return ; |
| 61 | - }else{ |
|
| 61 | + } else{ |
|
| 62 | 62 | $AccountExport=new AccountExport($account); |
| 63 | 63 | $filename="ContestAccount$cid"; |
| 64 | 64 | return Excel::download($AccountExport, $filename.'.xlsx'); |
@@ -65,12 +65,12 @@ |
||
| 65 | 65 | foreach ($ret as $gid => $group) { |
| 66 | 66 | if(empty($group['result'])){ |
| 67 | 67 | Log::channel('group_elo')->info('Refreshed Group Elo (Empty) : ('.$gid.')'.$group['name']); |
| 68 | - }else{ |
|
| 68 | + } else{ |
|
| 69 | 69 | Log::channel('group_elo')->info('Refreshing Group Elo: ('.$gid.')'.$group['name']); |
| 70 | 70 | foreach ($group['result'] as $contest) { |
| 71 | 71 | if($contest['ret'] == 'success'){ |
| 72 | 72 | Log::channel('group_elo')->info(' Elo Clac Successfully : ('.$contest['cid'].')'.$contest['name']); |
| 73 | - }else{ |
|
| 73 | + } else{ |
|
| 74 | 74 | Log::channel('group_elo')->info(' Elo Clac Faild (Judge Not Over) : ('.$contest['cid'].')'.$contest['name'].' sids:'); |
| 75 | 75 | foreach ($contest['submissions'] as $sid) { |
| 76 | 76 | Log::channel('group_elo')->info(' '.$sid['sid']); |