Skip to content

Commit

Permalink
Merge pull request #839 from project-primera/feat/admin-aggregate
Browse files Browse the repository at this point in the history
管理者用OD集計ページの表記をわかりやすく
  • Loading branch information
slime-hatena authored Apr 16, 2024
2 parents 2f0947e + 0157d7f commit f447dad
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 17 deletions.
15 changes: 14 additions & 1 deletion OngekiScoreLog/app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,20 @@ public function GetConfig(){

public function GetAggregate(){
$result = \App\AggregateOverdamage::all();
return view('admin/aggregate', compact(['result']));
$difficultyToStr = [
0 => 'Basic',
1 => 'Advanced',
2 => 'Expert',
3 => 'Master',
10 => 'Lunatic',
];

$musics = [];
$temp = \App\MusicData::all();
foreach ($temp as $value) {
$musics[$value->id] = $value->title;
}
return view('admin/aggregate', compact(['result', 'musics', 'difficultyToStr']));
}

/**
Expand Down
51 changes: 35 additions & 16 deletions OngekiScoreLog/resources/views/admin/aggregate.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,45 @@
@include('admin/_submenu', ['active' => 'aggregate'])
@endsection

@section('additional_footer')
<script type="text/javascript" src="{{ mix('/js/sortTable.js') }}"></script>
@endsection

@section('content')
<article class="box">
<h3 class="title is-3">集計一覧</h3>
<table class="table">
<thead>
<tr>
<th>id</th>
<th>max</th>
<th>updated_at</th>
</tr>
</thead>
<tbody>
@foreach ($result as $key => $value)
<div id="sort_table" class="table_wrap scalable">
<table class="table">
<thead>
<tr>
<th class="sort" data-sort="sort_key1">id</th>
<th>title</th>
<th>難易度</th>
<th class="sort" data-sort="sort_key2">max</th>
<th class="sort" data-sort="sort_key3">updated_at</th>
</tr>
</thead>
<tfoot>
<tr>
<td>{{$value->id}}</td>
<td>{{$value->max}}</td>
<td>{{$value->updated_at}}</td>
<th class="sort" data-sort="sort_key1">id</th>
<th>title</th>
<th>難易度</th>
<th class="sort" data-sort="sort_key2">max</th>
<th class="sort" data-sort="sort_key3">updated_at</th>
</tr>
@endforeach
</tbody>
</table>
</tfoot>
<tbody class="list">
@foreach ($result as $key => $value)
<tr>
<td class="sort_key1">{{$value->id}}</td>
<td>{{$musics[$value->song_id]}}</td>
<td>{{substr($difficultyToStr[$value->difficulty], 0, 3)}}</td>
<td class="sort_key2">{{$value->max}}</td>
<td class="sort_key3">{{$value->updated_at}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</article>
@endsection

0 comments on commit f447dad

Please sign in to comment.