...
|
...
|
@@ -214,11 +214,11 @@ class Index extends Api |
|
|
->distinct('l.team')
|
|
|
->join('team t', 't.title = l.team')
|
|
|
->where('l.campus_id', $campus)
|
|
|
->field('t.title,t.score,l.team,l.campus_ids')
|
|
|
->field('t.title,t.score,l.team,l.campus_id')
|
|
|
->order('t.score DESC')
|
|
|
->paginate($row, false, ['page' => $page])
|
|
|
->each(function ($item, $key) {
|
|
|
$res = db('study_score_log')->where('campus_id', $item['campus_ids'])->sum('score');
|
|
|
$res = db('study_score_log')->where('campus_id', $item['campus_id'])->sum('score');
|
|
|
$item['score'] = floor($item['score']);
|
|
|
$item['percent'] = round(($item['score'] * 0.6) / $res * 100, 2);
|
|
|
return $item;
|
...
|
...
|
|