@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | "aliases" => ["Apex", "apex"], |
| 266 | 266 | "mimetypes" => ["text/x-apex-source", "text/x-apex"] |
| 267 | 267 | ]]; |
| 268 | - foreach($tempLangConfig as $t){ |
|
| 268 | + foreach ($tempLangConfig as $t) { |
|
| 269 | 269 | $this->langConfig[$t["id"]]=$t; |
| 270 | 270 | } |
| 271 | 271 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | public function getJudgeStatus($sid, $uid) |
| 300 | 300 | { |
| 301 | 301 | $status=DB::table($this->tableName)->where(['sid'=>$sid])->first(); |
| 302 | - if($uid!=$status["uid"]){ |
|
| 302 | + if ($uid!=$status["uid"]) { |
|
| 303 | 303 | $status["solution"]=null; |
| 304 | 304 | } |
| 305 | 305 | $compilerModel=new CompilerModel(); |
@@ -309,12 +309,12 @@ discard block |
||
| 309 | 309 | |
| 310 | 310 | public function downloadCode($sid, $uid) |
| 311 | 311 | { |
| 312 | - $status=DB::table($this->tableName)->where(['sid'=>$sid,'uid'=>$uid])->first(); |
|
| 313 | - if(empty($status)){ |
|
| 312 | + $status=DB::table($this->tableName)->where(['sid'=>$sid, 'uid'=>$uid])->first(); |
|
| 313 | + if (empty($status)) { |
|
| 314 | 314 | return []; |
| 315 | 315 | } |
| 316 | 316 | $lang=DB::table("compiler")->where(['coid'=>$status["coid"]])->first()["lang"]; |
| 317 | - $curLang=isset($this->langConfig[$lang])?$this->langConfig[$lang]:$this->langConfig["plaintext"]; |
|
| 317 | + $curLang=isset($this->langConfig[$lang]) ? $this->langConfig[$lang] : $this->langConfig["plaintext"]; |
|
| 318 | 318 | return [ |
| 319 | 319 | "content"=>$status["solution"], |
| 320 | 320 | "name"=>$status["submission_date"].$curLang["extensions"][0], |
@@ -369,19 +369,19 @@ discard block |
||
| 369 | 369 | { |
| 370 | 370 | return DB::table($this->tableName) ->join('problem', 'problem.pid', '=', 'submission.pid') |
| 371 | 371 | ->select("sid", "OJ as oid", "remote_id", "cid") |
| 372 | - ->where(['verdict'=>'Waiting','OJ'=>$oid]) |
|
| 373 | - ->orderBy("sid","asc") |
|
| 372 | + ->where(['verdict'=>'Waiting', 'OJ'=>$oid]) |
|
| 373 | + ->orderBy("sid", "asc") |
|
| 374 | 374 | ->first(); |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | public function countEarliestWaitingSubmission($oid) |
| 378 | 378 | { |
| 379 | 379 | $early_sid=$this->getEarliestSubmission($oid); |
| 380 | - if($early_sid==null) return 0; |
|
| 380 | + if ($early_sid==null) return 0; |
|
| 381 | 381 | $early_sid=$early_sid["sid"]; |
| 382 | 382 | return DB::table($this->tableName) ->join('problem', 'problem.pid', '=', 'submission.pid') |
| 383 | 383 | ->where(['OJ'=>$oid]) |
| 384 | - ->where("sid",">=",$early_sid) |
|
| 384 | + ->where("sid", ">=", $early_sid) |
|
| 385 | 385 | ->count(); |
| 386 | 386 | } |
| 387 | 387 | |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | )->paginate(50); |
| 468 | 468 | |
| 469 | 469 | |
| 470 | - $records= $paginator->all(); |
|
| 470 | + $records=$paginator->all(); |
|
| 471 | 471 | foreach ($records as &$r) { |
| 472 | 472 | $r["submission_date_parsed"]=$this->formatSubmitTime(date('Y-m-d H:i:s', $r["submission_date"])); |
| 473 | 473 | $r["submission_date"]=date('Y-m-d H:i:s', $r["submission_date"]); |