Skip to content

Commit

Permalink
Merge pull request #849 from project-primera/feat/trophy-order
Browse files Browse the repository at this point in the history
称号の初期並び順を変更
  • Loading branch information
slime-hatena committed Apr 30, 2024
2 parents 59b8547 + ebd1320 commit 4847b54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getIndex(int $id){
$status[0]->badge .= '&nbsp;<span class="tag net-standard">OngekiNet Standard</span>';
}

$trophies = json_decode(json_encode(UserTrophy::where('user_id', $id)->get()), true);
$trophies = json_decode(json_encode(UserTrophy::where('user_id', $id)->orderBy('grade', 'desc')->orderBy('updated_at', 'desc')->get()), true);

$trophyIdToStr = [
0 => "ノーマル",
Expand Down
16 changes: 8 additions & 8 deletions OngekiScoreLog/resources/views/user_trophy.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@
</tr>
</tfoot>
<tbody class="list">
@for ($i = count($trophies) - 1; $i >= 0; --$i)
<tr>
<td class="sort_title">{{$trophies[$i]['name']}}</td>
<td class="sort_grade"><span class="sort-key">{{$trophies[$i]['grade']}}</span>{{$trophyIdToStr[$trophies[$i]['grade']]}}</td>
<td class="sort_detail">{{$trophies[$i]['detail']}}</td>
<td class="sort_update">{{date('Y-m-d', strtotime($trophies[$i]['updated_at']))}}</td>
</tr>
@endfor
@foreach ($trophies as $trophy)
<tr>
<td class="sort_title">{{$trophy['name']}}</td>
<td class="sort_grade"><span class="sort-key">{{$trophy['grade']}}</span>{{$trophyIdToStr[$trophy['grade']]}}</td>
<td class="sort_detail">{{$trophy['detail']}}</td>
<td class="sort_update">{{date('Y-m-d', strtotime($trophy['updated_at']))}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
Expand Down

0 comments on commit 4847b54

Please sign in to comment.