...
|
...
|
@@ -83,7 +83,7 @@ class Item extends Backend |
|
|
$res = db('study_score_log l')
|
|
|
->join('study s', 's.id = l.study_id')
|
|
|
->where('item_id', $data['id'])
|
|
|
->field('l.study_id,sum(l.score) as sum_score,s.name,s.sno,s.team_id')
|
|
|
->field('l.study_id,sum(l.score) as sum_score,s.name,s.sno,s.team_id,s.school_id,s.grade_id')
|
|
|
->group('l.study_id')
|
|
|
->order('sum_score', 'desc')
|
|
|
->select();
|
...
|
...
|
@@ -93,6 +93,8 @@ class Item extends Backend |
|
|
'name' => $v['name'],
|
|
|
'sno' => $v['sno'],
|
|
|
'title' => db('team')->where('id',$v['team_id'])->value('title'),
|
|
|
'school' => db('school')->where('id',$v['school_id'])->value('title'),
|
|
|
'grade' => db('grade')->where('id',$v['grade_id'])->value('name'),
|
|
|
'score' => $v['sum_score']
|
|
|
];
|
|
|
}
|
...
|
...
|
|