@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $ret=[]; |
| 23 | 23 | $marketspaceRaw=self::getRemote(); |
| 24 | - if(empty($marketspaceRaw)) return []; |
|
| 24 | + if(empty($marketspaceRaw)) { |
|
| 25 | + return []; |
|
| 26 | + } |
|
| 25 | 27 | foreach($marketspaceRaw["packages"] as $extension){ |
| 26 | 28 | $temp=[ |
| 27 | 29 | "details"=>$extension, |
@@ -35,7 +37,7 @@ discard block |
||
| 35 | 37 | try { |
| 36 | 38 | try { |
| 37 | 39 | $BabelConfig=json_decode(file_get_contents(babel_path("Extension/{$extension['code']}/babel.json")), true); |
| 38 | - }catch (Throwable $e){ |
|
| 40 | + } catch (Throwable $e){ |
|
| 39 | 41 | $BabelConfig=[]; |
| 40 | 42 | } |
| 41 | 43 | if (!empty($BabelConfig)) { |
@@ -61,7 +63,7 @@ discard block |
||
| 61 | 63 | $temp["available"]=$installedConfig->status; |
| 62 | 64 | } |
| 63 | 65 | } |
| 64 | - }catch (Throwable $e){ |
|
| 66 | + } catch (Throwable $e){ |
|
| 65 | 67 | $temp["status"]=-1; |
| 66 | 68 | } |
| 67 | 69 | $ret[]=$temp; |
@@ -74,7 +76,7 @@ discard block |
||
| 74 | 76 | { |
| 75 | 77 | try { |
| 76 | 78 | return json_decode(file_get_contents(env("BABEL_MIRROR", "https://acm.njupt.edu.cn/babel")."/babel.json"), true); |
| 77 | - }catch(Throwable $e){ |
|
| 79 | + } catch(Throwable $e){ |
|
| 78 | 80 | return []; |
| 79 | 81 | } |
| 80 | 82 | } |
@@ -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"); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | if($assign_uid != 0){ |
| 62 | 62 | $assignee = $groupModel->userProfile($assign_uid,$contest_detail['gid']); |
| 63 | - }else{ |
|
| 63 | + } else{ |
|
| 64 | 64 | $assignee = null; |
| 65 | 65 | } |
| 66 | 66 | $ret = [ |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | $contestModel->contestUpdate($cid,$all_data,$problemSet); |
| 222 | 222 | return ResponseModel::success(200); |
| 223 | - }else{ |
|
| 223 | + } else{ |
|
| 224 | 224 | $allow_update = ['name','description']; |
| 225 | 225 | |
| 226 | 226 | foreach($all_data as $key => $value){ |
@@ -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'); |
@@ -43,7 +43,9 @@ discard block |
||
| 43 | 43 | $groupModel=new GroupModel(); |
| 44 | 44 | $contestModel=new ContestModel(); |
| 45 | 45 | $basic_info=$groupModel->details($gcode); |
| 46 | - if(empty($basic_info)) return Redirect::route('group.index'); |
|
| 46 | + if(empty($basic_info)) { |
|
| 47 | + return Redirect::route('group.index'); |
|
| 48 | + } |
|
| 47 | 49 | $my_profile=$groupModel->userProfile(Auth::user()->id, $basic_info["gid"]); |
| 48 | 50 | $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id); |
| 49 | 51 | $member_list=$groupModel->userList($basic_info["gid"]); |
@@ -119,7 +121,7 @@ discard block |
||
| 119 | 121 | ), |
| 120 | 122 | $gcode . '_Group_Contest_Analysis.xlsx' |
| 121 | 123 | ); |
| 122 | - }else{ |
|
| 124 | + } else{ |
|
| 123 | 125 | $data = $groupModel->groupMemberPracticeTagStat($group_info['gid']); |
| 124 | 126 | return Excel::download( |
| 125 | 127 | new GroupAnalysisExport( |
@@ -43,7 +43,9 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $groupModel=new GroupModel(); |
| 45 | 45 | $basic_info=$groupModel->details($gcode); |
| 46 | - if(empty($basic_info)) return Redirect::route('group.index'); |
|
| 46 | + if(empty($basic_info)) { |
|
| 47 | + return Redirect::route('group.index'); |
|
| 48 | + } |
|
| 47 | 49 | $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id); |
| 48 | 50 | $member_list=$groupModel->userList($basic_info["gid"]); |
| 49 | 51 | return view('group.settings.general', [ |
@@ -85,7 +87,9 @@ discard block |
||
| 85 | 87 | { |
| 86 | 88 | $groupModel=new GroupModel(); |
| 87 | 89 | $basic_info=$groupModel->details($gcode); |
| 88 | - if(empty($basic_info)) return Redirect::route('group.index'); |
|
| 90 | + if(empty($basic_info)) { |
|
| 91 | + return Redirect::route('group.index'); |
|
| 92 | + } |
|
| 89 | 93 | return view('group.settings.danger', [ |
| 90 | 94 | 'page_title'=>"Group Setting danger", |
| 91 | 95 | 'site_title'=>config("app.name"), |
@@ -104,7 +108,9 @@ discard block |
||
| 104 | 108 | $groupModel=new GroupModel(); |
| 105 | 109 | $contestModel=new ContestModel(); |
| 106 | 110 | $basic_info=$groupModel->details($gcode); |
| 107 | - if(empty($basic_info)) return Redirect::route('group.index'); |
|
| 111 | + if(empty($basic_info)) { |
|
| 112 | + return Redirect::route('group.index'); |
|
| 113 | + } |
|
| 108 | 114 | $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id); |
| 109 | 115 | $member_list=$groupModel->userList($basic_info["gid"]); |
| 110 | 116 | $group_notice=$groupModel->detailNotice($gcode); |
@@ -124,7 +130,9 @@ discard block |
||
| 124 | 130 | $groupModel=new GroupModel(); |
| 125 | 131 | $contestModel=new ContestModel(); |
| 126 | 132 | $basic_info=$groupModel->details($gcode); |
| 127 | - if(empty($basic_info)) return Redirect::route('group.index'); |
|
| 133 | + if(empty($basic_info)) { |
|
| 134 | + return Redirect::route('group.index'); |
|
| 135 | + } |
|
| 128 | 136 | $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id); |
| 129 | 137 | $contest_list=$contestModel->listForSetting($basic_info["gid"]); |
| 130 | 138 | $member_list=$groupModel->userList($basic_info["gid"]); |
@@ -244,11 +244,17 @@ |
||
| 244 | 244 | |
| 245 | 245 | $groupModel=new GroupModel(); |
| 246 | 246 | $is_user=$groupModel->isUser($all_data["email"]); |
| 247 | - if(!$is_user) return ResponseModel::err(2006); |
|
| 247 | + if(!$is_user) { |
|
| 248 | + return ResponseModel::err(2006); |
|
| 249 | + } |
|
| 248 | 250 | $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id); |
| 249 | - if($clearance<2) return ResponseModel::err(7002); |
|
| 251 | + if($clearance<2) { |
|
| 252 | + return ResponseModel::err(7002); |
|
| 253 | + } |
|
| 250 | 254 | $targetClearance=$groupModel->judgeEmailClearance($all_data["gid"], $all_data["email"]); |
| 251 | - if($targetClearance!=-3) return ResponseModel::err(7003); |
|
| 255 | + if($targetClearance!=-3) { |
|
| 256 | + return ResponseModel::err(7003); |
|
| 257 | + } |
|
| 252 | 258 | $groupModel->inviteMember($all_data["gid"], $all_data["email"]); |
| 253 | 259 | return ResponseModel::success(200); |
| 254 | 260 | } |
@@ -69,9 +69,13 @@ |
||
| 69 | 69 | $all_data=$request->all(); |
| 70 | 70 | |
| 71 | 71 | $groupModel=new GroupModel(); |
| 72 | - if($all_data["gcode"]=="create") return ResponseModel::err(7005); |
|
| 72 | + if($all_data["gcode"]=="create") { |
|
| 73 | + return ResponseModel::err(7005); |
|
| 74 | + } |
|
| 73 | 75 | $is_group=$groupModel->isGroup($all_data["gcode"]); |
| 74 | - if($is_group) return ResponseModel::err(7006); |
|
| 76 | + if($is_group) { |
|
| 77 | + return ResponseModel::err(7006); |
|
| 78 | + } |
|
| 75 | 79 | |
| 76 | 80 | $allow_extension=['jpg', 'png', 'jpeg', 'gif', 'bmp']; |
| 77 | 81 | if (!empty($request->file('img')) && $request->file('img')->isValid()) { |