@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | if($assign_uid != 0){ |
68 | 68 | $assignee = $groupModel->userProfile($assign_uid,$contest_detail['gid']); |
69 | - }else{ |
|
69 | + } else{ |
|
70 | 70 | $assignee = null; |
71 | 71 | } |
72 | 72 | $ret = [ |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | $contestModel->contestUpdate($cid,$all_data,$problemSet); |
144 | 144 | return ResponseModel::success(200); |
145 | - }else{ |
|
145 | + } else{ |
|
146 | 146 | $allow_update = ['name','description']; |
147 | 147 | |
148 | 148 | foreach($all_data as $key => $value){ |
@@ -325,7 +325,9 @@ discard block |
||
325 | 325 | if ($contestModel->judgeClearance($cid,Auth::user()->id) != 3){ |
326 | 326 | return ResponseModel::err(2001); |
327 | 327 | } |
328 | - if(!is_null(Cache::tags(['contest', 'admin', 'PDFGenerate'])->get($cid))) return ResponseModel::err(8001); |
|
328 | + if(!is_null(Cache::tags(['contest', 'admin', 'PDFGenerate'])->get($cid))) { |
|
329 | + return ResponseModel::err(8001); |
|
330 | + } |
|
329 | 331 | $generateProcess=new GeneratePDF($cid,$config); |
330 | 332 | dispatch($generateProcess)->onQueue('normal'); |
331 | 333 | Cache::tags(['contest', 'admin', 'PDFGenerate'])->put($cid, $generateProcess->getJobStatusId()); |
@@ -344,7 +346,9 @@ discard block |
||
344 | 346 | if ($contestModel->judgeClearance($cid,Auth::user()->id) != 3){ |
345 | 347 | return ResponseModel::err(2001); |
346 | 348 | } |
347 | - if(!is_null(Cache::tags(['contest', 'admin', 'anticheat'])->get($cid))) return ResponseModel::err(8001); |
|
349 | + if(!is_null(Cache::tags(['contest', 'admin', 'anticheat'])->get($cid))) { |
|
350 | + return ResponseModel::err(8001); |
|
351 | + } |
|
348 | 352 | if(EloquentContestModel::find($cid)->isJudgingComplete()) { |
349 | 353 | $anticheatProcess=new AntiCheat($cid); |
350 | 354 | dispatch($anticheatProcess)->onQueue('normal'); |
@@ -184,9 +184,13 @@ |
||
184 | 184 | $all_data=$request->all(); |
185 | 185 | |
186 | 186 | $groupModel=new OutdatedGroupModel(); |
187 | - if($all_data["gcode"]=="create") return ResponseModel::err(7005); |
|
187 | + if($all_data["gcode"]=="create") { |
|
188 | + return ResponseModel::err(7005); |
|
189 | + } |
|
188 | 190 | $is_group=$groupModel->isGroup($all_data["gcode"]); |
189 | - if($is_group) return ResponseModel::err(7006); |
|
191 | + if($is_group) { |
|
192 | + return ResponseModel::err(7006); |
|
193 | + } |
|
190 | 194 | |
191 | 195 | $allow_extension=['jpg', 'png', 'jpeg', 'gif', 'bmp']; |
192 | 196 | if (!empty($request->file('img')) && $request->file('img')->isValid()) { |
@@ -89,7 +89,9 @@ discard block |
||
89 | 89 | $groupModel = new GroupModel(); |
90 | 90 | $basic_info=$groupModel->details($gcode); |
91 | 91 | $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id); |
92 | - if($clearance < 1) return Redirect::route('group.detail',['gcode' => $gcode]); |
|
92 | + if($clearance < 1) { |
|
93 | + return Redirect::route('group.detail',['gcode' => $gcode]); |
|
94 | + } |
|
93 | 95 | $group_info = $groupModel->details($gcode); |
94 | 96 | return view('group.settings.analysis', [ |
95 | 97 | 'page_title'=>"Group Analysis", |
@@ -121,7 +123,7 @@ discard block |
||
121 | 123 | ), |
122 | 124 | $gcode . '_Group_Contest_Analysis.xlsx' |
123 | 125 | ); |
124 | - }else{ |
|
126 | + } else{ |
|
125 | 127 | $data = $groupModel->groupMemberPracticeTagStat($group_info['gid']); |
126 | 128 | return Excel::download( |
127 | 129 | new GroupAnalysisExport( |
@@ -35,7 +35,7 @@ |
||
35 | 35 | return response()->view('errors.451',[ |
36 | 36 | 'description' => "Your account is currently blocked and will remain so until {$banned->removed_at}. Here's why: {$banned->reason}", |
37 | 37 | ]); |
38 | - }else{ |
|
38 | + } else{ |
|
39 | 39 | return response()->json([ |
40 | 40 | 'ret' => 451, |
41 | 41 | 'desc' => 'Unavailable For Legal Reasons', |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $group = Group::where('gcode',$gcode)->first(); |
21 | 21 | if(!empty($group)){ |
22 | 22 | return $next($request); |
23 | - }else{ |
|
23 | + } else{ |
|
24 | 24 | return redirect('/group'); |
25 | 25 | } |
26 | 26 |
@@ -129,7 +129,7 @@ |
||
129 | 129 | 'removed_at' => $ban_time |
130 | 130 | ]); |
131 | 131 | return ; |
132 | - }else{ |
|
132 | + } else{ |
|
133 | 133 | sendMessage([ |
134 | 134 | 'sender' => 1, |
135 | 135 | 'receiver' => $abuse->user_id, |
@@ -74,7 +74,7 @@ |
||
74 | 74 | $p = ProblemModel::where('pcode','like',$prefix.'%')->orderBy('pcode','desc')->select('pcode')->first(); |
75 | 75 | if(empty($p)){ |
76 | 76 | $count = 1000; |
77 | - }else{ |
|
77 | + } else{ |
|
78 | 78 | $count = (int) str_replace($prefix,'',$p['pcode']); |
79 | 79 | } |
80 | 80 |
@@ -121,7 +121,9 @@ discard block |
||
121 | 121 | public function details($gcode) |
122 | 122 | { |
123 | 123 | $basic_info=DB::table($this->tableName)->where(["gcode"=>$gcode])->first(); |
124 | - if(empty($basic_info)) return []; |
|
124 | + if(empty($basic_info)) { |
|
125 | + return []; |
|
126 | + } |
|
125 | 127 | $basic_info["members"]=$this->countGroupMembers($basic_info["gid"]); |
126 | 128 | $basic_info["tags"]=$this->getGroupTags($basic_info["gid"]); |
127 | 129 | $basic_info["create_time_foramt"]=date_format(date_create($basic_info["created_at"]), 'M jS, Y'); |
@@ -169,7 +171,9 @@ discard block |
||
169 | 171 | foreach ($user_list as &$u) { |
170 | 172 | $u["role_parsed"]=$this->role[$u["role"]]; |
171 | 173 | $u["role_color"]=$this->role_color[$u["role"]]; |
172 | - if(is_null($u["sub_group"])) $u["sub_group"]="None"; |
|
174 | + if(is_null($u["sub_group"])) { |
|
175 | + $u["sub_group"]="None"; |
|
176 | + } |
|
173 | 177 | } |
174 | 178 | return $user_list; |
175 | 179 | } |
@@ -238,7 +242,7 @@ discard block |
||
238 | 242 | ->where('gid',$gid) |
239 | 243 | ->distinct() |
240 | 244 | ->get()->all(); |
241 | - }else{ |
|
245 | + } else{ |
|
242 | 246 | $tags = DB::table('group_problem_tag') |
243 | 247 | ->select('tag') |
244 | 248 | ->where('gid', $gid) |
@@ -272,7 +276,7 @@ discard block |
||
272 | 276 | foreach($problems as $key => $value){ |
273 | 277 | if($contestModel->judgeClearance($value['cid'],$user_id) != 3){ |
274 | 278 | unset($problems[$key]); |
275 | - }else{ |
|
279 | + } else{ |
|
276 | 280 | $problems[$key]['tags'] = $this->problemTags($gid,$value['pid']); |
277 | 281 | } |
278 | 282 | } |
@@ -333,7 +337,9 @@ discard block |
||
333 | 337 | public function judgeEmailClearance($gid, $email) |
334 | 338 | { |
335 | 339 | $user=DB::table("users")->where(["email"=>$email])->first(); |
336 | - if(empty($user)) return -4; |
|
340 | + if(empty($user)) { |
|
341 | + return -4; |
|
342 | + } |
|
337 | 343 | $ret=DB::table("group_member")->where([ |
338 | 344 | "gid"=>$gid, |
339 | 345 | "uid"=>$user["id"], |
@@ -467,7 +473,7 @@ discard block |
||
467 | 473 | if(!empty($last_cr)){ |
468 | 474 | if($cr['solved'] == $last_cr['solved'] && $cr['penalty'] == $last_cr['penalty'] ){ |
469 | 475 | $rank = $last_rank; |
470 | - }else{ |
|
476 | + } else{ |
|
471 | 477 | $rank = $index; |
472 | 478 | $last_rank = $rank; |
473 | 479 | } |
@@ -619,7 +625,7 @@ discard block |
||
619 | 625 | 'cid' => $contest['cid'], |
620 | 626 | 'name' => $contest['name'] |
621 | 627 | ]; |
622 | - }else{ |
|
628 | + } else{ |
|
623 | 629 | $result[] = [ |
624 | 630 | 'ret' => 'judging', |
625 | 631 | 'cid' => $contest['cid'], |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
38 | - }elseif ($config['type'] == 2) { //to a leader that member agree to join the group |
|
38 | + } elseif ($config['type'] == 2) { //to a leader that member agree to join the group |
|
39 | 39 | $messages = Message::where([ |
40 | 40 | 'receiver' => $config['receiver'], |
41 | 41 | 'type' => $config['type'], |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | } |
54 | 54 | } |
55 | - }elseif ($config['type'] == 3) { //to a person that solution was passed |
|
55 | + } elseif ($config['type'] == 3) { //to a person that solution was passed |
|
56 | 56 | $message = Message::where([ |
57 | 57 | 'receiver' => $config['receiver'], |
58 | 58 | 'type' => $config['type'], |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $message->save(); |
66 | 66 | return true; |
67 | 67 | } |
68 | - }elseif ($config['type'] == 4) { //to a person that solution was blocked |
|
68 | + } elseif ($config['type'] == 4) { //to a person that solution was blocked |
|
69 | 69 | $message = Message::where([ |
70 | 70 | 'receiver' => $config['receiver'], |
71 | 71 | 'type' => $config['type'], |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if(isset($config['data']) && isset($config['type'])){ |
88 | 88 | $message->type = $config['type'] ?? null; |
89 | 89 | $message->data = json_encode($config['data']); |
90 | - }else{ |
|
90 | + } else{ |
|
91 | 91 | $message->content = $config['content']; |
92 | 92 | } |
93 | 93 | /* |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $del_count ++; |
202 | 202 | } |
203 | 203 | } |
204 | - }else{ |
|
204 | + } else{ |
|
205 | 205 | $message = static::find($messages); |
206 | 206 | if(!empty($message)){ |
207 | 207 | $message->delete(); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $content = substr($content,0,strlen($content)-2); |
224 | 224 | $content .= " want to join your group [{$data['group']['name']}]({$data['group']['url']})"; |
225 | 225 | return $content; |
226 | - }elseif($this->type == 2) { |
|
226 | + } elseif($this->type == 2) { |
|
227 | 227 | foreach($data['user'] as $user) { |
228 | 228 | $content .= "[{$user['name']}]({$user['url']}), "; |
229 | 229 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $content .= " have agreed to join your group [{$data['group']['name']}]({$data['group']['url']})"; |
232 | 232 | return $content; |
233 | 233 | } //todo |
234 | - }else{ |
|
234 | + } else{ |
|
235 | 235 | return $value; |
236 | 236 | } |
237 | 237 | } |