Compare commits

...

9 Commits

Author SHA1 Message Date
ca283fc9a9 app/Http/Controllers/RegularContractCreateController.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 23s
2025-10-07 17:07:42 +09:00
d84b0fb9e1 app/Http/Controllers/RegularContractCreateController.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 23s
2025-10-07 16:54:59 +09:00
e80b0639ca resources/views/regular_contract/create.blade.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 26s
2025-10-07 16:46:29 +09:00
3cad3b3d0f Merge pull request '駐輪場検索画面 並び替え条件修正' (#43) from main_higashide into main
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 25s
Reviewed-on: #43
2025-10-07 16:17:22 +09:00
29f40c37bb app/Http/Controllers/RegularContractCreateController.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 23s
2025-10-07 15:56:39 +09:00
8d33e2bf78 app/Http/Controllers/RegularContractCreateController.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 23s
2025-10-07 15:54:00 +09:00
57efa7f63e app/Http/Controllers/RegularContractCreateController.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 24s
2025-10-07 15:49:14 +09:00
9d9717863e app/Http/Controllers/RegularContractCreateController.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 24s
2025-10-07 15:32:25 +09:00
f22f447a86 Merge pull request '駐輪場検索画面 並び替え条件修正' (#42) from main_higashide into main
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 27s
Reviewed-on: #42
2025-10-07 15:27:46 +09:00
2 changed files with 18 additions and 6 deletions

View File

@ -82,6 +82,7 @@ class RegularContractCreateController extends Controller
// 並び替えパラメータ取得
$sort = request()->input('sort', 'park_id');
$order = request()->input('order', 'asc');
\Log::info('sort param: ' . $sort);
$sortable = [
'park_ruby' => 'park.park_ruby',
'city_id' => 'city.city_id',
@ -98,14 +99,13 @@ class RegularContractCreateController extends Controller
$parks_table = $query->skip(($page - 1) * $perPage)->take($perPage)->get();
if ($sort === 'park_ruby' || $sort === 'station_name_ruby') {
setlocale(LC_COLLATE, 'ja_JP.UTF-8');
$parks_table = $parks_table->sort(function ($a, $b) use ($order, $sort) {
// null対策
$collator = new \Collator('ja_JP');
$parks_table = $parks_table->sort(function ($a, $b) use ($order, $sort, $collator) {
$a_val = $a->$sort ?? '';
$b_val = $b->$sort ?? '';
return $order === 'asc'
? strcoll($a_val, $b_val)
: strcoll($b_val, $a_val);
? $collator->compare($a_val, $b_val)
: $collator->compare($b_val, $a_val);
})->values();
}

View File

@ -54,7 +54,7 @@
</div>
</form>
<div style="overflow-x: auto; width: 100%;">
<table id="searchTable" class="table table-striped">
<table id="searchTable" class="tablesorter table table-striped">
<thead>
<tr>
<th class="header">
@ -202,4 +202,16 @@
</div>
</div>
</div>
<script>
document.querySelectorAll('#searchTable th a, #searchTable .header a').forEach(function(el) {
el.addEventListener('click', function(e) {
// サーバーに遷移させる
window.location.href = el.href;
// 既存のJSによるイベントを止める
e.stopImmediatePropagation();
e.preventDefault();
return false;
}, true); // trueでキャプチャフェーズに
});
</script>
@endsection