作者 开飞机的舒克

后台优化

... ... @@ -113,16 +113,18 @@ class Screen extends Backend
$res = db('study_score_log l')
->distinct('l.study_id')
->join('study s','l.study_id = s.id')
->join('team t','t.id = s.team_id')
->field('s.name,s.earn_score,t.title,t.id')
->order('s.earn_score','desc')
->join('team t','t.id = l.team_id')
->field('s.name,sum(l.score) as sum_score,t.title,t.id')
->order('sum_score','desc')
->group('l.study_id')
->where('campus_id', $data['campus_id'])
->limit(40)
->select();
$list = [];
foreach ($res as $k => $v){
$list[] = [
'name' => $v['name'],
'score' => $v['earn_score'],
'score' => $v['sum_score'],
'title'=>$v['title'],
'rank'=> $k+1
];
... ...