【利用者マスタ】件数カウント
All checks were successful
Deploy main / deploy (push) Successful in 22s

This commit is contained in:
你的名字 2025-10-30 16:38:22 +09:00
parent a17960f61c
commit 1d7e3941b5

View File

@ -3,40 +3,40 @@
@section('title', '利用者マスタ') @section('title', '利用者マスタ')
@section('content') @section('content')
@php @php
$curSort = $sort ?? request('sort', 'user_seq'); $curSort = $sort ?? request('sort', 'user_seq');
$curDir = strtolower($dir ?? request('dir', $sort_type ?? 'desc')); $curDir = strtolower($dir ?? request('dir', $sort_type ?? 'desc'));
if (!in_array($curDir, ['asc', 'desc'], true)) { if (!in_array($curDir, ['asc', 'desc'], true)) {
$curDir = 'desc'; $curDir = 'desc';
}
$queryBase = collect([
'user_id' => $user_id ?? null,
'user_categoryid' => $user_categoryid ?? null,
'user_tag_serial' => $user_tag_serial ?? null,
'quit_flag' => $quit_flag ?? null,
'user_phonetic' => $user_phonetic ?? null,
'phone' => $phone ?? null,
'email' => $email ?? null,
'tag_qr_flag' => $tag_qr_flag ?? null,
'quit_from' => $quit_from ?? null,
'quit_to' => $quit_to ?? null,
])->filter(function ($value) {
return !is_null($value) && $value !== '';
})->all();
$thClass = function (string $key) use ($curSort, $curDir) {
if ($curSort !== $key) {
return 'sorting';
} }
return $curDir === 'asc' ? 'sorting_asc' : 'sorting_desc';
};
$urlFor = function (string $key) use ($curSort, $curDir, $queryBase) { $queryBase = collect([
$next = ($curSort === $key && $curDir === 'asc') ? 'desc' : 'asc'; 'user_id' => $user_id ?? null,
return route('users', array_merge($queryBase, ['sort' => $key, 'dir' => $next])); 'user_categoryid' => $user_categoryid ?? null,
}; 'user_tag_serial' => $user_tag_serial ?? null,
@endphp 'quit_flag' => $quit_flag ?? null,
'user_phonetic' => $user_phonetic ?? null,
'phone' => $phone ?? null,
'email' => $email ?? null,
'tag_qr_flag' => $tag_qr_flag ?? null,
'quit_from' => $quit_from ?? null,
'quit_to' => $quit_to ?? null,
])->filter(function ($value) {
return !is_null($value) && $value !== '';
})->all();
$thClass = function (string $key) use ($curSort, $curDir) {
if ($curSort !== $key) {
return 'sorting';
}
return $curDir === 'asc' ? 'sorting_asc' : 'sorting_desc';
};
$urlFor = function (string $key) use ($curSort, $curDir, $queryBase) {
$next = ($curSort === $key && $curDir === 'asc') ? 'desc' : 'asc';
return route('users', array_merge($queryBase, ['sort' => $key, 'dir' => $next]));
};
@endphp
{{-- コンテンツヘッダー(パンくず) --}} {{-- コンテンツヘッダー(パンくず) --}}
<div class="content-header"> <div class="content-header">
<div class="container-fluid"> <div class="container-fluid">
@ -242,6 +242,10 @@
<input type="hidden" name="quit_to" value="{{ $quit_to ?? '' }}"> <input type="hidden" name="quit_to" value="{{ $quit_to ?? '' }}">
</form> </form>
<div class="text-right mb-2">
{{ $list->total() }} 件中 {{ $list->firstItem() }}{{ $list->lastItem() }} 件を表示
</div>
<div class="d-flex align-items-center mb-2"> <div class="d-flex align-items-center mb-2">
<div> <div>
<a href="{{ route('users_add') }}" class="btn btn-primary">新規</a> <a href="{{ route('users_add') }}" class="btn btn-primary">新規</a>
@ -259,7 +263,8 @@
@csrf @csrf
<div id="users-list" class="table-responsive"> <div id="users-list" class="table-responsive">
<table class="table table-bordered table-hover text-nowrap table-users dataTable" style="min-width:1200px;"> <table class="table table-bordered table-hover text-nowrap table-users dataTable"
style="min-width:1200px;">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th style="width:110px;" class="{{ $thClass('user_id') }}"> <th style="width:110px;" class="{{ $thClass('user_id') }}">
@ -296,15 +301,16 @@
? route('user_edit', ['seq' => $item->user_seq]) ? route('user_edit', ['seq' => $item->user_seq])
: url('/users/edit/' . $item->user_seq)); : url('/users/edit/' . $item->user_seq));
$chk = (string) ($item->user_idcard_chk_flag ?? '0'); $chk = (string) ($item->user_idcard_chk_flag ?? '0');
$categoryDisplay = collect([ $categoryDisplay = collect([
$item->usertype_subject1 ?? '', $item->usertype_subject1 ?? '',
$item->usertype_subject2 ?? '', $item->usertype_subject2 ?? '',
$item->usertype_subject3 ?? '', $item->usertype_subject3 ?? '',
])->filter(fn ($v) => $v !== '')->implode('/'); ])->filter(fn($v) => $v !== '')->implode('/');
@endphp @endphp
<tr> <tr>
{{-- 利用者IDリンク --}} {{-- 利用者IDリンク --}}
<td class="text-nowrap"><a href="{{ $userEditUrl }}">{{ $item->user_id }} {{ $item->user_name }}</a></td> <td class="text-nowrap"><a href="{{ $userEditUrl }}">{{ $item->user_id }}
{{ $item->user_name }}</a></td>
{{-- タグQR --}} {{-- タグQR --}}
<td>{{ $item->tag_qr_flag ? '' : 'タグ' }}</td> <td>{{ $item->tag_qr_flag ? '' : 'タグ' }}</td>
{{-- 利用者分類ID氏名フリガナ --}} {{-- 利用者分類ID氏名フリガナ --}}
@ -345,6 +351,7 @@
#users-list tfoot th { #users-list tfoot th {
background: #fff !important; background: #fff !important;
} }
.table-users thead th .header-link { .table-users thead th .header-link {
color: #212529 !important; color: #212529 !important;
text-decoration: none !important; text-decoration: none !important;
@ -352,6 +359,7 @@
white-space: nowrap; white-space: nowrap;
padding-right: 1.8rem; padding-right: 1.8rem;
} }
.table-users.dataTable thead th.sorting, .table-users.dataTable thead th.sorting,
.table-users.dataTable thead th.sorting_asc, .table-users.dataTable thead th.sorting_asc,
.table-users.dataTable thead th.sorting_desc { .table-users.dataTable thead th.sorting_desc {