作者 开飞机的舒克

大屏管理

@@ -85,10 +85,10 @@ class Screen extends Backend @@ -85,10 +85,10 @@ 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_id = t.id') 88 + ->join('team t', 'l.team = t.title')
89 ->where('campus_id', $data['campus_id']) 89 ->where('campus_id', $data['campus_id'])
90 - ->field('l.team_id,sum(l.score) as sum_score,t.title')  
91 - ->group('l.team_id') 90 + ->field('l.team,sum(l.score) as sum_score,t.title')
  91 + ->group('l.team')
92 ->order('sum_score', 'desc') 92 ->order('sum_score', 'desc')
93 ->limit(4) 93 ->limit(4)
94 ->select(); 94 ->select();
@@ -119,8 +119,7 @@ class Screen extends Backend @@ -119,8 +119,7 @@ class Screen extends Backend
119 $res = db('study_score_log l') 119 $res = db('study_score_log l')
120 ->distinct('l.study_id') 120 ->distinct('l.study_id')
121 ->join('study s','l.study_id = s.id') 121 ->join('study s','l.study_id = s.id')
122 - ->join('team t','t.id = l.team_id')  
123 - ->field('s.name,sum(l.score) as sum_score,t.title,t.id') 122 + ->field('s.name,sum(l.score) as sum_score,l.team')
124 ->order('sum_score','desc') 123 ->order('sum_score','desc')
125 ->group('l.study_id') 124 ->group('l.study_id')
126 ->where('campus_id', $data['campus_id']) 125 ->where('campus_id', $data['campus_id'])
@@ -131,7 +130,7 @@ class Screen extends Backend @@ -131,7 +130,7 @@ class Screen extends Backend
131 $list[] = [ 130 $list[] = [
132 'name' => $v['name'], 131 'name' => $v['name'],
133 'score' => $v['sum_score'], 132 'score' => $v['sum_score'],
134 - 'title'=>$v['title'], 133 + 'title'=>$v['team'],
135 'rank'=> $k+1 134 'rank'=> $k+1
136 ]; 135 ];
137 } 136 }