ちょっとした問題があります。データベースに「player_skills」というテーブルがあります。次のような列が含まれています (例):
player_id | スキル ID | 値 | カウント
player_id は、実際には「players」テーブルの下の列「id」にあるプレーヤーの ID です。また、8つのスキルがあります。Value はデフォルト値です (この場合は関係ありません)。カウントは値(プレイヤーのスキルの値)です。
基本的に、私が欲しいのはデータを Bootstrap タブに取り込むことです (例):
<div class="tabbable tabs-left">
<ul class="nav nav-tabs">
<li class="active"><a href="?skill0" data-toggle="tab">Section 1</a></li>
<li><a href="?skill1" data-toggle="tab">Section 2</a></li>
<li><a href="?skill2" data-toggle="tab">Section 3</a></li>
...
</ul>
<div class="tab-content">
<div class="tab-pane active" id="?skill0">
<p>I'm in Section A.</p>
</div>
<div class="tab-pane" id="?skill1">
<p>Howdy, I'm in Section B.</p>
</div>
<div class="tab-pane" id="?skill2">
<p>What up girl, this is Section C.</p>
</div>
</div>
</div>
私はそれを注文したいです(最高から最低まで、(また、すべてのプレーヤーに「group_id」列があるため、group_idが3に等しいプレーヤーを含めたくありません)が、スキルごとに) . また、「プレイヤー」テーブル (「経験」と呼ばれる列) にあるスキルが 1 つあり、次のようにしました。
public function highscores()
{
$players = Player::orderBy('experience','desc')->get();
return View::make('aac.highscores')->with('players', $players);
}
問題なく動作しますが、スキルごとに変更するにはタブで必要です。