|
@@ -85,9 +85,8 @@ class Screen extends Backend |
|
@@ -85,9 +85,8 @@ class Screen extends Backend |
85
|
}
|
85
|
}
|
86
|
$data = $row->toArray();
|
86
|
$data = $row->toArray();
|
87
|
$res = db('study_score_log l')
|
87
|
$res = db('study_score_log l')
|
88
|
- ->join('team t', 'l.team = t.title')
|
|
|
89
|
->where('campus_id', $data['campus_id'])
|
88
|
->where('campus_id', $data['campus_id'])
|
90
|
- ->field('l.team,sum(l.score) as sum_score,t.title')
|
89
|
+ ->field('l.team,sum(l.score) as sum_score')
|
91
|
->group('l.team')
|
90
|
->group('l.team')
|
92
|
->order('sum_score', 'desc')
|
91
|
->order('sum_score', 'desc')
|
93
|
->limit(4)
|
92
|
->limit(4)
|
|
@@ -95,7 +94,7 @@ class Screen extends Backend |
|
@@ -95,7 +94,7 @@ class Screen extends Backend |
95
|
$list = [];
|
94
|
$list = [];
|
96
|
foreach ($res as $k => $v) {
|
95
|
foreach ($res as $k => $v) {
|
97
|
$list[] = [
|
96
|
$list[] = [
|
98
|
- 'title' => $v['title'],
|
97
|
+ 'title' => $v['team'],
|
99
|
'score' => $v['sum_score'],
|
98
|
'score' => $v['sum_score'],
|
100
|
];
|
99
|
];
|
101
|
}
|
100
|
}
|