Merge pull request '駐輪場検索画面 並び替え条件修正' (#42) from main_higashide into main
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 27s
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 27s
Reviewed-on: #42
This commit is contained in:
commit
f22f447a86
@ -97,6 +97,18 @@ class RegularContractCreateController extends Controller
|
|||||||
$total = $query->count();
|
$total = $query->count();
|
||||||
$parks_table = $query->skip(($page - 1) * $perPage)->take($perPage)->get();
|
$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対策
|
||||||
|
$a_val = $a->$sort ?? '';
|
||||||
|
$b_val = $b->$sort ?? '';
|
||||||
|
return $order === 'asc'
|
||||||
|
? strcoll($a_val, $b_val)
|
||||||
|
: strcoll($b_val, $a_val);
|
||||||
|
})->values();
|
||||||
|
}
|
||||||
|
|
||||||
// zoneテーブルデータを取得(psectionテーブルとJOINしてpsection_subjectも取得)
|
// zoneテーブルデータを取得(psectionテーブルとJOINしてpsection_subjectも取得)
|
||||||
$zones = DB::table('zone')
|
$zones = DB::table('zone')
|
||||||
->leftJoin('psection', 'zone.psection_id', '=', 'psection.psection_id')
|
->leftJoin('psection', 'zone.psection_id', '=', 'psection.psection_id')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user