作者 开飞机的舒克

后台优化

@@ -116,6 +116,7 @@ class Screen extends Backend @@ -116,6 +116,7 @@ class Screen extends Backend
116 ->join('team t','t.id = s.team_id') 116 ->join('team t','t.id = s.team_id')
117 ->field('s.name,s.earn_score,t.title,t.id') 117 ->field('s.name,s.earn_score,t.title,t.id')
118 ->order('s.earn_score','desc') 118 ->order('s.earn_score','desc')
  119 + ->limit(40)
119 ->select(); 120 ->select();
120 $list = []; 121 $list = [];
121 foreach ($res as $k => $v){ 122 foreach ($res as $k => $v){
@@ -123,6 +124,7 @@ class Screen extends Backend @@ -123,6 +124,7 @@ class Screen extends Backend
123 'name' => $v['name'], 124 'name' => $v['name'],
124 'score' => $v['earn_score'], 125 'score' => $v['earn_score'],
125 'title'=>$v['title'], 126 'title'=>$v['title'],
  127 + 'rank'=> $k+1
126 ]; 128 ];
127 } 129 }
128 $this->view->assign("row", $list); 130 $this->view->assign("row", $list);
1 <table class="table table-striped"> 1 <table class="table table-striped">
2 <thead> 2 <thead>
3 <tr> 3 <tr>
  4 + <th>{:__('名次')}</th>
4 <th>{:__('姓名')}</th> 5 <th>{:__('姓名')}</th>
5 <th>{:__('个人得分')}</th> 6 <th>{:__('个人得分')}</th>
6 <th>{:__('所属战队')}</th> 7 <th>{:__('所属战队')}</th>
@@ -9,6 +10,7 @@ @@ -9,6 +10,7 @@
9 <tbody> 10 <tbody>
10 {volist name="row" id="vo"} 11 {volist name="row" id="vo"}
11 <tr> 12 <tr>
  13 + <td>{$vo.rank}</td>
12 <td>{$vo.name}</td> 14 <td>{$vo.name}</td>
13 <td style="word-break: break-all;">{$vo.score}</td> 15 <td style="word-break: break-all;">{$vo.score}</td>
14 <td style="word-break: break-all;">{$vo.title}</td> 16 <td style="word-break: break-all;">{$vo.title}</td>