作者 开飞机的舒克

后台大屏管理优化

... ... @@ -186,18 +186,16 @@ class Screen extends Backend
$this->success("Ajax请求成功", null, ['id' => $ids]);
}
$data = $row->toArray();
$res = db('stud y_score_log l')
->whereIn('campus_ids', $data['campus_id'])
->field('l.team,sum(l.score) as sum_score')
->group('l.team')
->order('sum_score', 'desc')
$res = db('team_score')
->where('ronda_id', $data['ronda_id'])
->order('score', 'desc')
->limit(4)
->select();
$list = [];
foreach ($res as $k => $v) {
$list[] = [
'title' => $v['team'],
'score' => $v['sum_score'],
'title' => \db('team')->where('id',$v['team_id'])->value('title'),
'score' => $v['score'],
];
}
$this->view->assign("row", $list);
... ... @@ -217,21 +215,15 @@ class Screen extends Backend
$this->success("Ajax请求成功", null, ['id' => $ids]);
}
$data = $row->toArray();
$res = db('study_score_log l')
->distinct('l.study_id')
->join('study s','l.study_id = s.id')
->field('s.name,sum(l.score) as sum_score,l.team')
->order('sum_score','desc')
->group('l.study_id')
->whereIn('campus_ids', $data['campus_id'])
->limit(40)
$res = db('study_ronda_score')
->where('ronda_id',$data['ronda_id'])
->select();
$list = [];
foreach ($res as $k => $v){
$list[] = [
'name' => $v['name'],
'score' => $v['sum_score'],
'title'=>$v['team'],
'name' => \db('study')->where('id',$v['sid'])->value('name'),
'score' => $v['score'],
'title'=>\db('study')->where('id',$v['sid'])->value('team'),
'rank'=> $k+1
];
}
... ...
... ... @@ -12,8 +12,8 @@
<tr>
<td>{$vo.rank}</td>
<td>{$vo.name}</td>
<td style="word-break: break-all;">{$vo.score}</td>
<td style="word-break: break-all;">{$vo.title}</td>
<td style="word-break: break-all;">{$vo.score}</td>
</tr>
{/volist}
</tbody>
... ...