@@ -13,20 +13,20 @@ |
||
13 | 13 | |
14 | 14 | public function search($key) |
15 | 15 | { |
16 | - $result = []; |
|
17 | - if(strlen($key) >= 2){ |
|
18 | - $ret = self::where('pcode', $key) |
|
19 | - ->orWhereRaw('MATCH(`title`) AGAINST (? IN BOOLEAN MODE)',[$key]) |
|
16 | + $result=[]; |
|
17 | + if (strlen($key)>=2) { |
|
18 | + $ret=self::where('pcode', $key) |
|
19 | + ->orWhereRaw('MATCH(`title`) AGAINST (? IN BOOLEAN MODE)', [$key]) |
|
20 | 20 | ->select('pcode', 'title') |
21 | 21 | ->limit(120) |
22 | 22 | ->get()->all(); |
23 | - if(!empty($ret)){ |
|
24 | - $result += $ret; |
|
23 | + if (!empty($ret)) { |
|
24 | + $result+=$ret; |
|
25 | 25 | } |
26 | 26 | } |
27 | - $problemModel = new ProblemModel(); |
|
27 | + $problemModel=new ProblemModel(); |
|
28 | 28 | foreach ($result as $p_index => $p) { |
29 | - if($problemModel->isBlocked($p['pid']) || $problemModel->isHidden($p["pid"])){ |
|
29 | + if ($problemModel->isBlocked($p['pid']) || $problemModel->isHidden($p["pid"])) { |
|
30 | 30 | unset($result[$p_index]); |
31 | 31 | } |
32 | 32 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | $grid->score("Raw Score"); |
99 | 99 | $grid->filter(function(Grid\Filter $filter) { |
100 | 100 | $filter->like('verdict'); |
101 | - $filter->column(4, function ($filter) { |
|
101 | + $filter->column(4, function($filter) { |
|
102 | 102 | $filter->equal('cid', 'Contest ID'); |
103 | 103 | $filter->equal('uid', 'User ID'); |
104 | 104 | $filter->equal('pid', 'Problem ID'); |