作者 开飞机的舒克

后台优化

... ... @@ -46,19 +46,18 @@ class Screen extends Api
->value('title');
$list['time'] = date('Y-m-d H:i:s',time());
$list['team_rank'] = \db('study_score_log')
->field('SUM(score) as sum_score,team_id')
->field('SUM(score) as sum_score,team_id,campus_id')
->where('campus_id',$data['campus_id'])
->group('team_id')
->order('sum_score DESC')
->limit(4)
->select();
$list['study_rank'] = db('study_score_log')
->field('study_id,SUM(score) as sum_score,team_id')
->where('campus_id',$data['campus_id'])
->order('sum_score DESC')
->group('study_id')
->limit('0,10')
->select();
->paginate(4)
->each(function ($item,$key){
$res = db('study_score_log')->where('campus_id',$item['campus_id'])->sum('score');
$item['score'] = floor($item['sum_score']);
$item['percent'] = round($item['score'] / $res * 100,2);
$item['study'] = db('study')->where('team_id',$item['team_id'])->field('name,earn_score')->select();
return $item;
});
$this->success('获取成功',$list);
}
... ...
... ... @@ -4973,7 +4973,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-14 13:41:04 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-15 15:30:50 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...