作者 开飞机的舒克

大屏接口优化

... ... @@ -55,7 +55,17 @@ class Screen extends Api
$res = db('study_score_log')->where('campus_id',$item['campus_id'])->sum('score');
$item['score'] = floor($item['sum_score']);
$item['percent'] = round(($item['score']*0.6) / $res * 100,2);
$item['study'] = db('study')->where('team_id',$item['team_id'])->field('name,earn_score')->order('earn_score','desc')->select();
$item['study'] = db('study_score_log l')
->distinct('l.study_id')
->join('study s','l.study_id = s.id')
->where([
'l.campus_id'=>$item['campus_id'],
's.team_id'=>$item['team_id']
])
->field('s.name,sum(score) as sum_score')
->order('sum_score','desc')
->group('study_id')
->select();
return $item;
});
$this->success('获取成功',$list);
... ...
... ... @@ -4973,7 +4973,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-15 15:53:52 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-15 16:50:58 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...