...
|
...
|
@@ -171,9 +171,14 @@ class Index extends Api |
|
|
->distinct('l.team_id')
|
|
|
->join('team t', 't.id = l.team_id')
|
|
|
->where('l.campus_id', $campus)
|
|
|
->field('t.title,t.score,l.team_id')
|
|
|
->field('t.title,t.score,l.team_id,l.campus_id')
|
|
|
->order('t.score DESC')
|
|
|
->paginate($row, false, ['page' => $page]);
|
|
|
->paginate($row, false, ['page' => $page])
|
|
|
->each(function ($item,$key){
|
|
|
$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);
|
|
|
});
|
|
|
//最终显示
|
|
|
$this->success('战队排行榜', $data);
|
|
|
}
|
...
|
...
|
|