作者 开飞机的舒克

首页项目校区展示问题

... ... @@ -213,12 +213,12 @@ class Index extends Api
$data = \db('study_score_log l')
->distinct('l.team')
->join('team t', 't.title = l.team')
->whereIn('l.campus_ids', $campus)
->where('l.campus_id', $campus)
->field('t.title,t.score,l.team,l.campus_ids')
->order('t.score DESC')
->paginate($row, false, ['page' => $page])
->each(function ($item, $key) {
$res = db('study_score_log')->where('campus_ids', $item['campus_ids'])->sum('score');
$res = db('study_score_log')->where('campus_id', $item['campus_ids'])->sum('score');
$item['score'] = floor($item['score']);
$item['percent'] = round(($item['score'] * 0.6) / $res * 100, 2);
return $item;
... ... @@ -264,7 +264,7 @@ class Index extends Api
//个人排行榜
$data = \db('study_score_log')
->field('id,SUM(score) as sum_score,study_id')
->whereIn('campus_ids', $campus)
->where('campus_id', $campus)
->group('study_id')
->order('sum_score DESC')
->paginate($row, false, ['page' => $page])
... ...
... ... @@ -6324,7 +6324,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-04-21 17:22:14 <a href="./" target="_blank">校园活动</a>
Generated on 2023-04-23 14:14:47 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...