Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function apply($model, BaseRepositoryInterface $repository) |
||
11 | { |
||
12 | app('db')->connection()->statement('SET sql_mode = \'\''); |
||
13 | $rawCount = 'count(*) as att'; |
||
14 | $rawGrade = 'min(10000000000000000000 + time_cost * 100000000000 + memory_cost * 100000) as score'; |
||
15 | |||
16 | return $model->select( |
||
17 | 'id', |
||
18 | 'problem_id', |
||
19 | 'user_id', |
||
20 | 'language', |
||
21 | 'memory_cost', |
||
22 | 'time_cost', |
||
23 | 'created_at', |
||
24 | app('db')->raw($rawCount), |
||
25 | app('db')->raw($rawGrade) |
||
26 | ); |
||
29 |