| Total Complexity | 45 |
| Total Lines | 531 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
Complex classes like SubmissionModel often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use SubmissionModel, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 9 | class SubmissionModel extends Model |
||
| 10 | { |
||
| 11 | protected $tableName='submission'; |
||
| 12 | protected $table='submission'; |
||
| 13 | protected $primaryKey = 'sid'; |
||
| 14 | const DELETED_AT=null; |
||
| 15 | const UPDATED_AT=null; |
||
| 16 | const CREATED_AT=null; |
||
| 17 | |||
| 18 | public $colorScheme=[ |
||
| 19 | "Waiting" => "wemd-blue-text", |
||
| 20 | "Judge Error" => "wemd-black-text", |
||
| 21 | "System Error" => "wemd-black-text", |
||
| 22 | "Compile Error" => "wemd-orange-text", |
||
| 23 | "Runtime Error" => "wemd-red-text", |
||
| 24 | "Wrong Answer" => "wemd-red-text", |
||
| 25 | "Time Limit Exceed" => "wemd-deep-purple-text", |
||
| 26 | "Real Time Limit Exceed" => "wemd-deep-purple-text", |
||
| 27 | "Accepted" => "wemd-green-text", |
||
| 28 | "Memory Limit Exceed" => "wemd-deep-purple-text", |
||
| 29 | "Presentation Error" => "wemd-red-text", |
||
| 30 | "Submitted" => "wemd-blue-text", |
||
| 31 | "Pending" => "wemd-blue-text", |
||
| 32 | "Judging" => "wemd-blue-text", |
||
| 33 | "Partially Accepted" => "wemd-cyan-text", |
||
| 34 | 'Submission Error' => 'wemd-black-text', |
||
| 35 | 'Output Limit Exceeded' => 'wemd-deep-purple-text', |
||
| 36 | "Idleness Limit Exceed" => 'wemd-deep-purple-text' |
||
| 37 | ]; |
||
| 38 | public $langConfig=[]; |
||
| 39 | |||
| 40 | public function __construct() |
||
| 41 | { |
||
| 42 | $tempLangConfig=[[ |
||
| 43 | "id" => "plaintext", |
||
| 44 | "extensions" => [".txt", ".gitignore"], |
||
| 45 | "aliases" => ["Plain Text", "text"], |
||
| 46 | "mimetypes" => ["text/plain"] |
||
| 47 | ], [ |
||
| 48 | "id" => "json", |
||
| 49 | "extensions" => [".json", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc"], |
||
| 50 | "aliases" => ["JSON", "json"], |
||
| 51 | "mimetypes" => ["application/json"] |
||
| 52 | ], [ |
||
| 53 | "id" => "bat", |
||
| 54 | "extensions" => [".bat", ".cmd"], |
||
| 55 | "aliases" => ["Batch", "bat"] |
||
| 56 | ], [ |
||
| 57 | "id" => "coffeescript", |
||
| 58 | "extensions" => [".coffee"], |
||
| 59 | "aliases" => ["CoffeeScript", "coffeescript", "coffee"], |
||
| 60 | "mimetypes" => ["text/x-coffeescript", "text/coffeescript"] |
||
| 61 | ], [ |
||
| 62 | "id" => "c", |
||
| 63 | "extensions" => [".c", ".h"], |
||
| 64 | "aliases" => ["C", "c"] |
||
| 65 | ], [ |
||
| 66 | "id" => "cpp", |
||
| 67 | "extensions" => [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx"], |
||
| 68 | "aliases" => ["C++", "Cpp", "cpp"] |
||
| 69 | ], [ |
||
| 70 | "id" => "csharp", |
||
| 71 | "extensions" => [".cs", ".csx", ".cake"], |
||
| 72 | "aliases" => ["C#", "csharp"] |
||
| 73 | ], [ |
||
| 74 | "id" => "csp", |
||
| 75 | "extensions" => [], |
||
| 76 | "aliases" => ["CSP", "csp"] |
||
| 77 | ], [ |
||
| 78 | "id" => "css", |
||
| 79 | "extensions" => [".css"], |
||
| 80 | "aliases" => ["CSS", "css"], |
||
| 81 | "mimetypes" => ["text/css"] |
||
| 82 | ], [ |
||
| 83 | "id" => "dockerfile", |
||
| 84 | "extensions" => [".dockerfile"], |
||
| 85 | "filenames" => ["Dockerfile"], |
||
| 86 | "aliases" => ["Dockerfile"] |
||
| 87 | ], [ |
||
| 88 | "id" => "fsharp", |
||
| 89 | "extensions" => [".fs", ".fsi", ".ml", ".mli", ".fsx", ".fsscript"], |
||
| 90 | "aliases" => ["F#", "FSharp", "fsharp"] |
||
| 91 | ], [ |
||
| 92 | "id" => "go", |
||
| 93 | "extensions" => [".go"], |
||
| 94 | "aliases" => ["Go"] |
||
| 95 | ], [ |
||
| 96 | "id" => "handlebars", |
||
| 97 | "extensions" => [".handlebars", ".hbs"], |
||
| 98 | "aliases" => ["Handlebars", "handlebars"], |
||
| 99 | "mimetypes" => ["text/x-handlebars-template"] |
||
| 100 | ], [ |
||
| 101 | "id" => "html", |
||
| 102 | "extensions" => [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm"], |
||
| 103 | "aliases" => ["HTML", "htm", "html", "xhtml"], |
||
| 104 | "mimetypes" => ["text/html", "text/x-jshtm", "text/template", "text/ng-template"] |
||
| 105 | ], [ |
||
| 106 | "id" => "ini", |
||
| 107 | "extensions" => [".ini", ".properties", ".gitconfig"], |
||
| 108 | "filenames" => ["config", ".gitattributes", ".gitconfig", ".editorconfig"], |
||
| 109 | "aliases" => ["Ini", "ini"] |
||
| 110 | ], [ |
||
| 111 | "id" => "java", |
||
| 112 | "extensions" => [".java", ".jav"], |
||
| 113 | "aliases" => ["Java", "java"], |
||
| 114 | "mimetypes" => ["text/x-java-source", "text/x-java"] |
||
| 115 | ], [ |
||
| 116 | "id" => "javascript", |
||
| 117 | "extensions" => [".js", ".es6", ".jsx"], |
||
| 118 | "firstLine" => "^#!.*\\bnode", |
||
| 119 | "filenames" => ["jakefile"], |
||
| 120 | "aliases" => ["JavaScript", "javascript", "js"], |
||
| 121 | "mimetypes" => ["text/javascript"] |
||
| 122 | ], [ |
||
| 123 | "id" => "less", |
||
| 124 | "extensions" => [".less"], |
||
| 125 | "aliases" => ["Less", "less"], |
||
| 126 | "mimetypes" => ["text/x-less", "text/less"] |
||
| 127 | ], [ |
||
| 128 | "id" => "lua", |
||
| 129 | "extensions" => [".lua"], |
||
| 130 | "aliases" => ["Lua", "lua"] |
||
| 131 | ], [ |
||
| 132 | "id" => "markdown", |
||
| 133 | "extensions" => [".md", ".markdown", ".mdown", ".mkdn", ".mkd", ".mdwn", ".mdtxt", ".mdtext"], |
||
| 134 | "aliases" => ["Markdown", "markdown"] |
||
| 135 | ], [ |
||
| 136 | "id" => "msdax", |
||
| 137 | "extensions" => [".dax", ".msdax"], |
||
| 138 | "aliases" => ["DAX", "MSDAX"] |
||
| 139 | ], [ |
||
| 140 | "id" => "mysql", |
||
| 141 | "extensions" => [], |
||
| 142 | "aliases" => ["MySQL", "mysql"] |
||
| 143 | ], [ |
||
| 144 | "id" => "objective-c", |
||
| 145 | "extensions" => [".m"], |
||
| 146 | "aliases" => ["Objective-C"] |
||
| 147 | ], [ |
||
| 148 | "id" => "pgsql", |
||
| 149 | "extensions" => [], |
||
| 150 | "aliases" => ["PostgreSQL", "postgres", "pg", "postgre"] |
||
| 151 | ], [ |
||
| 152 | "id" => "php", |
||
| 153 | "extensions" => [".php", ".php4", ".php5", ".phtml", ".ctp"], |
||
| 154 | "aliases" => ["PHP", "php"], |
||
| 155 | "mimetypes" => ["application/x-php"] |
||
| 156 | ], [ |
||
| 157 | "id" => "postiats", |
||
| 158 | "extensions" => [".dats", ".sats", ".hats"], |
||
| 159 | "aliases" => ["ATS", "ATS/Postiats"] |
||
| 160 | ], [ |
||
| 161 | "id" => "powerquery", |
||
| 162 | "extensions" => [".pq", ".pqm"], |
||
| 163 | "aliases" => ["PQ", "M", "Power Query", "Power Query M"] |
||
| 164 | ], [ |
||
| 165 | "id" => "powershell", |
||
| 166 | "extensions" => [".ps1", ".psm1", ".psd1"], |
||
| 167 | "aliases" => ["PowerShell", "powershell", "ps", "ps1"] |
||
| 168 | ], [ |
||
| 169 | "id" => "pug", |
||
| 170 | "extensions" => [".jade", ".pug"], |
||
| 171 | "aliases" => ["Pug", "Jade", "jade"] |
||
| 172 | ], [ |
||
| 173 | "id" => "python", |
||
| 174 | "extensions" => [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"], |
||
| 175 | "aliases" => ["Python", "py"], |
||
| 176 | "firstLine" => "^#!/.*\\bpython[0-9.-]*\\b" |
||
| 177 | ], [ |
||
| 178 | "id" => "r", |
||
| 179 | "extensions" => [".r", ".rhistory", ".rprofile", ".rt"], |
||
| 180 | "aliases" => ["R", "r"] |
||
| 181 | ], [ |
||
| 182 | "id" => "razor", |
||
| 183 | "extensions" => [".cshtml"], |
||
| 184 | "aliases" => ["Razor", "razor"], |
||
| 185 | "mimetypes" => ["text/x-cshtml"] |
||
| 186 | ], [ |
||
| 187 | "id" => "redis", |
||
| 188 | "extensions" => [".redis"], |
||
| 189 | "aliases" => ["redis"] |
||
| 190 | ], [ |
||
| 191 | "id" => "redshift", |
||
| 192 | "extensions" => [], |
||
| 193 | "aliases" => ["Redshift", "redshift"] |
||
| 194 | ], [ |
||
| 195 | "id" => "ruby", |
||
| 196 | "extensions" => [".rb", ".rbx", ".rjs", ".gemspec", ".pp"], |
||
| 197 | "filenames" => ["rakefile"], |
||
| 198 | "aliases" => ["Ruby", "rb"] |
||
| 199 | ], [ |
||
| 200 | "id" => "rust", |
||
| 201 | "extensions" => [".rs", ".rlib"], |
||
| 202 | "aliases" => ["Rust", "rust"] |
||
| 203 | ], [ |
||
| 204 | "id" => "sb", |
||
| 205 | "extensions" => [".sb"], |
||
| 206 | "aliases" => ["Small Basic", "sb"] |
||
| 207 | ], [ |
||
| 208 | "id" => "scss", |
||
| 209 | "extensions" => [".scss"], |
||
| 210 | "aliases" => ["Sass", "sass", "scss"], |
||
| 211 | "mimetypes" => ["text/x-scss", "text/scss"] |
||
| 212 | ], [ |
||
| 213 | "id" => "sol", |
||
| 214 | "extensions" => [".sol"], |
||
| 215 | "aliases" => ["sol", "solidity", "Solidity"] |
||
| 216 | ], [ |
||
| 217 | "id" => "sql", |
||
| 218 | "extensions" => [".sql"], |
||
| 219 | "aliases" => ["SQL"] |
||
| 220 | ], [ |
||
| 221 | "id" => "st", |
||
| 222 | "extensions" => [".st", ".iecst", ".iecplc", ".lc3lib"], |
||
| 223 | "aliases" => ["StructuredText", "scl", "stl"] |
||
| 224 | ], [ |
||
| 225 | "id" => "swift", |
||
| 226 | "aliases" => ["Swift", "swift"], |
||
| 227 | "extensions" => [".swift"], |
||
| 228 | "mimetypes" => ["text/swift"] |
||
| 229 | ], [ |
||
| 230 | "id" => "typescript", |
||
| 231 | "extensions" => [".ts", ".tsx"], |
||
| 232 | "aliases" => ["TypeScript", "ts", "typescript"], |
||
| 233 | "mimetypes" => ["text/typescript"] |
||
| 234 | ], [ |
||
| 235 | "id" => "vb", |
||
| 236 | "extensions" => [".vb"], |
||
| 237 | "aliases" => ["Visual Basic", "vb"] |
||
| 238 | ], [ |
||
| 239 | "id" => "xml", |
||
| 240 | "extensions" => [".xml", ".dtd", ".ascx", ".csproj", ".config", ".wxi", ".wxl", ".wxs", ".xaml", ".svg", ".svgz"], |
||
| 241 | "firstLine" => "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)", |
||
| 242 | "aliases" => ["XML", "xml"], |
||
| 243 | "mimetypes" => ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"] |
||
| 244 | ], [ |
||
| 245 | "id" => "yaml", |
||
| 246 | "extensions" => [".yaml", ".yml"], |
||
| 247 | "aliases" => ["YAML", "yaml", "YML", "yml"], |
||
| 248 | "mimetypes" => ["application/x-yaml"] |
||
| 249 | ], [ |
||
| 250 | "id" => "scheme", |
||
| 251 | "extensions" => [".scm", ".ss", ".sch", ".rkt"], |
||
| 252 | "aliases" => ["scheme", "Scheme"] |
||
| 253 | ], [ |
||
| 254 | "id" => "clojure", |
||
| 255 | "extensions" => [".clj", ".clojure"], |
||
| 256 | "aliases" => ["clojure", "Clojure"] |
||
| 257 | ], [ |
||
| 258 | "id" => "shell", |
||
| 259 | "extensions" => [".sh", ".bash"], |
||
| 260 | "aliases" => ["Shell", "sh"] |
||
| 261 | ], [ |
||
| 262 | "id" => "perl", |
||
| 263 | "extensions" => [".pl"], |
||
| 264 | "aliases" => ["Perl", "pl"] |
||
| 265 | ], [ |
||
| 266 | "id" => "azcli", |
||
| 267 | "extensions" => [".azcli"], |
||
| 268 | "aliases" => ["Azure CLI", "azcli"] |
||
| 269 | ], [ |
||
| 270 | "id" => "apex", |
||
| 271 | "extensions" => [".cls"], |
||
| 272 | "aliases" => ["Apex", "apex"], |
||
| 273 | "mimetypes" => ["text/x-apex-source", "text/x-apex"] |
||
| 274 | ]]; |
||
| 275 | foreach ($tempLangConfig as $t) { |
||
| 276 | $this->langConfig[$t["id"]]=$t; |
||
| 277 | } |
||
| 278 | } |
||
| 279 | |||
| 280 | public function insert($sub) |
||
| 281 | { |
||
| 282 | if (strlen($sub['verdict'])==0) { |
||
| 283 | $sub['verdict']="Judge Error"; |
||
| 284 | } |
||
| 285 | |||
| 286 | $sid=DB::table($this->tableName)->insertGetId([ |
||
| 287 | 'time' => $sub['time'], |
||
| 288 | 'verdict' => $sub['verdict'], |
||
| 289 | 'solution' => $sub['solution'], |
||
| 290 | 'language' => $sub['language'], |
||
| 291 | 'submission_date' => $sub['submission_date'], |
||
| 292 | 'memory' => $sub['memory'], |
||
| 293 | 'uid' => $sub['uid'], |
||
| 294 | 'pid' => $sub['pid'], |
||
| 295 | 'cid' => $sub['cid'], |
||
| 296 | 'color' => $this->colorScheme[$sub['verdict']], |
||
| 297 | 'remote_id'=>$sub['remote_id'], |
||
| 298 | 'compile_info'=>"", |
||
| 299 | 'coid'=>$sub['coid'], |
||
| 300 | 'score'=>$sub['score'] |
||
| 301 | ]); |
||
| 302 | |||
| 303 | return $sid; |
||
| 304 | } |
||
| 305 | |||
| 306 | public function getJudgeStatus($sid, $uid) |
||
| 307 | { |
||
| 308 | $status=DB::table($this->tableName)->where(['sid'=>$sid])->first(); |
||
| 309 | if (empty($status)) { |
||
| 310 | return []; |
||
| 311 | } |
||
| 312 | if ($status["share"]==1 && $status["cid"]) { |
||
| 313 | $end_time=strtotime(DB::table("contest")->where(["cid"=>$status["cid"]])->select("end_time")->first()["end_time"]); |
||
| 314 | if(time()<$end_time) $status["solution"]=null; |
||
| 315 | } |
||
| 316 | if ($status["share"]==0 && $status["uid"]!=$uid) { |
||
| 317 | $status["solution"]=null; |
||
| 318 | } |
||
| 319 | $compilerModel=new CompilerModel(); |
||
| 320 | $status["lang"]=$compilerModel->detail($status["coid"])["lang"]; |
||
| 321 | $status["owner"]=$uid==$status["uid"]; |
||
| 322 | return $status; |
||
| 323 | } |
||
| 324 | |||
| 325 | public function downloadCode($sid, $uid) |
||
| 326 | { |
||
| 327 | $status=DB::table($this->tableName)->where(['sid'=>$sid])->first(); |
||
| 328 | if (empty($status) || ($status["share"]==0 && $status["uid"]!=$uid)) { |
||
| 329 | return []; |
||
| 330 | } |
||
| 331 | $lang=DB::table("compiler")->where(['coid'=>$status["coid"]])->first()["lang"]; |
||
| 332 | $curLang=isset($this->langConfig[$lang]) ? $this->langConfig[$lang] : $this->langConfig["plaintext"]; |
||
| 333 | return [ |
||
| 334 | "content"=>$status["solution"], |
||
| 335 | "name"=>$status["submission_date"].$curLang["extensions"][0], |
||
| 336 | ]; |
||
| 337 | } |
||
| 338 | |||
| 339 | public function getProblemStatus($pid, $uid, $cid=null) |
||
| 340 | { |
||
| 341 | if ($cid) { |
||
| 342 | $end_time=strtotime(DB::table("contest")->where(["cid"=>$cid])->select("end_time")->first()["end_time"]); |
||
| 343 | // Get the very first AC record |
||
| 344 | $ac=DB::table($this->tableName)->where([ |
||
| 345 | 'pid'=>$pid, |
||
| 346 | 'uid'=>$uid, |
||
| 347 | 'cid'=>$cid, |
||
| 348 | 'verdict'=>'Accepted' |
||
| 349 | ])->where("submission_date", "<", $end_time)->orderBy('submission_date', 'desc')->first(); |
||
| 350 | if (empty($ac)) { |
||
| 351 | $pac=DB::table($this->tableName)->where([ |
||
| 352 | 'pid'=>$pid, |
||
| 353 | 'uid'=>$uid, |
||
| 354 | 'cid'=>$cid, |
||
| 355 | 'verdict'=>'Partially Accepted' |
||
| 356 | ])->where("submission_date", "<", $end_time)->orderBy('submission_date', 'desc')->first(); |
||
| 357 | return empty($pac) ? DB::table($this->tableName)->where(['pid'=>$pid, 'uid'=>$uid, 'cid'=>$cid])->where("submission_date", "<", $end_time)->orderBy('submission_date', 'desc')->first() : $pac; |
||
| 358 | } else { |
||
| 359 | return $ac; |
||
| 360 | } |
||
| 361 | } else { |
||
| 362 | $ac=DB::table($this->tableName)->where([ |
||
| 363 | 'pid'=>$pid, |
||
| 364 | 'uid'=>$uid, |
||
| 365 | 'cid'=>$cid, |
||
| 366 | 'verdict'=>'Accepted' |
||
| 367 | ])->orderBy('submission_date', 'desc')->first(); |
||
| 368 | return empty($ac) ? DB::table($this->tableName)->where(['pid'=>$pid, 'uid'=>$uid, 'cid'=>$cid])->orderBy('submission_date', 'desc')->first() : $ac; |
||
| 369 | } |
||
| 370 | } |
||
| 371 | |||
| 372 | public function getProblemSubmission($pid, $uid, $cid=null) |
||
| 373 | { |
||
| 374 | $statusList=DB::table($this->tableName)->where(['pid'=>$pid, 'uid'=>$uid, 'cid'=>$cid])->orderBy('submission_date', 'desc')->limit(10)->get()->all(); |
||
| 375 | return $statusList; |
||
| 376 | } |
||
| 377 | |||
| 378 | public function countSolution($s) |
||
| 379 | { |
||
| 380 | return DB::table($this->tableName)->where(['solution'=>$s])->count(); |
||
| 381 | } |
||
| 382 | |||
| 383 | public function getEarliestSubmission($oid) |
||
| 384 | { |
||
| 385 | return DB::table($this->tableName) ->join('problem', 'problem.pid', '=', 'submission.pid') |
||
| 386 | ->select("sid", "OJ as oid", "remote_id", "cid") |
||
| 387 | ->where(['verdict'=>'Waiting', 'OJ'=>$oid]) |
||
| 388 | ->orderBy("sid", "asc") |
||
| 389 | ->first(); |
||
| 390 | } |
||
| 391 | |||
| 392 | public function countEarliestWaitingSubmission($oid) |
||
| 403 | } |
||
| 404 | |||
| 405 | |||
| 406 | public function getWaitingSubmission() |
||
| 407 | { |
||
| 408 | return DB::table($this->tableName) ->join('problem', 'problem.pid', '=', 'submission.pid') |
||
| 409 | ->select("sid", "OJ as oid", "remote_id", "cid", "jid") |
||
| 410 | ->where(['verdict'=>'Waiting']) |
||
| 411 | ->get(); |
||
| 412 | } |
||
| 413 | |||
| 414 | public function countWaitingSubmission($oid) |
||
| 415 | { |
||
| 416 | return DB::table($this->tableName) ->join('problem', 'problem.pid', '=', 'submission.pid') |
||
| 417 | ->where(['verdict'=>'Waiting', 'OJ'=>$oid]) |
||
| 418 | ->count(); |
||
| 419 | } |
||
| 420 | |||
| 421 | public function updateSubmission($sid, $sub) |
||
| 422 | { |
||
| 423 | if (isset($sub['verdict'])) { |
||
| 424 | $sub["color"]=$this->colorScheme[$sub['verdict']]; |
||
| 425 | } |
||
| 426 | return DB::table($this->tableName)->where(['sid'=>$sid])->update($sub); |
||
| 427 | } |
||
| 428 | |||
| 429 | public function formatSubmitTime($date) |
||
| 460 | } |
||
| 461 | |||
| 462 | public function getRecord() |
||
| 463 | { |
||
| 464 | $paginator=DB::table("submission")->where([ |
||
| 465 | 'cid'=>null |
||
| 466 | ])->join( |
||
| 467 | "users", |
||
| 468 | "users.id", |
||
| 469 | "=", |
||
| 470 | "submission.uid" |
||
| 471 | )->join( |
||
| 472 | "problem", |
||
| 473 | "problem.pid", |
||
| 474 | "=", |
||
| 475 | "submission.pid" |
||
| 476 | )->select( |
||
| 477 | "sid", |
||
| 478 | "uid", |
||
| 479 | "problem.pid as pid", |
||
| 480 | "pcode", |
||
| 481 | "name", |
||
| 482 | "color", |
||
| 483 | "verdict", |
||
| 484 | "time", |
||
| 485 | "memory", |
||
| 486 | "language", |
||
| 487 | "score", |
||
| 488 | "submission_date", |
||
| 489 | "share" |
||
| 490 | )->orderBy( |
||
| 491 | 'submission_date', |
||
| 492 | 'desc' |
||
| 493 | )->paginate(50); |
||
| 494 | |||
| 495 | |||
| 496 | $records=$paginator->all(); |
||
| 497 | foreach ($records as &$r) { |
||
| 498 | $r["submission_date_parsed"]=$this->formatSubmitTime(date('Y-m-d H:i:s', $r["submission_date"])); |
||
| 499 | $r["submission_date"]=date('Y-m-d H:i:s', $r["submission_date"]); |
||
| 500 | $r["nick_name"]=""; |
||
| 501 | } |
||
| 502 | return [ |
||
| 503 | "paginator"=>$paginator, |
||
| 504 | "records"=>$records |
||
| 505 | ]; |
||
| 506 | } |
||
| 507 | |||
| 508 | public function share($sid,$uid) |
||
| 517 | ]; |
||
| 518 | } |
||
| 519 | |||
| 520 | public function sharePB($sid,$uid) |
||
| 540 | ]; |
||
| 541 | } |
||
| 542 | } |
||
| 543 | } |
||
| 544 |