This commit is contained in:
parent
00f39f15f4
commit
d1277a2b4a
@ -78,30 +78,32 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
view()->composer('layouts.app', function($view){
|
view()->composer('layouts.app', function($view){
|
||||||
|
|
||||||
|
// 未対応のみ集計
|
||||||
$stats = DB::table('operator_que')
|
$stats = DB::table('operator_que')
|
||||||
->selectRaw("
|
->selectRaw("
|
||||||
SUM(CASE WHEN que_status IN (1,2) AND que_class < 100 THEN 1 ELSE 0 END) AS task_total,
|
SUM(CASE WHEN que_status = 1 AND que_class < 100 THEN 1 ELSE 0 END) AS task_untreated,
|
||||||
MAX(CASE WHEN que_status IN (1,2) AND que_class < 100 THEN created_at END) AS task_latest,
|
MAX(CASE WHEN que_status = 1 AND que_class < 100 THEN created_at END) AS task_latest,
|
||||||
SUM(CASE WHEN que_status IN (1,2) AND que_class > 99 THEN 1 ELSE 0 END) AS hard_total,
|
SUM(CASE WHEN que_status = 1 AND que_class > 99 THEN 1 ELSE 0 END) AS hard_untreated,
|
||||||
MAX(CASE WHEN que_status IN (1,2) AND que_class > 99 THEN created_at END) AS hard_latest
|
MAX(CASE WHEN que_status = 1 AND que_class > 99 THEN created_at END) AS hard_latest
|
||||||
")
|
")
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$taskCount = (int)($stats->task_total ?? 0);
|
// 変数名は互換維持(内容は未対応件数)
|
||||||
$hardCount = (int)($stats->hard_total ?? 0);
|
$taskCount = (int)($stats->task_untreated ?? 0);
|
||||||
|
$hardCount = (int)($stats->hard_untreated ?? 0);
|
||||||
$taskLatest = $stats->task_latest ?? null;
|
$taskLatest = $stats->task_latest ?? null;
|
||||||
$hardLatest = $stats->hard_latest ?? null;
|
$hardLatest = $stats->hard_latest ?? null;
|
||||||
|
|
||||||
// 最新5件 (未対応/作業中)
|
// ドロップダウン最新5件 も未対応のみ
|
||||||
$latestTasks = DB::table('operator_que')
|
$latestTasks = DB::table('operator_que')
|
||||||
->whereIn('que_status',[1,2])
|
->where('que_status',1)
|
||||||
->where('que_class','<',100)
|
->where('que_class','<',100)
|
||||||
->orderByDesc('created_at')
|
->orderByDesc('created_at')
|
||||||
->limit(5)
|
->limit(5)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$latestHards = DB::table('operator_que')
|
$latestHards = DB::table('operator_que')
|
||||||
->whereIn('que_status',[1,2])
|
->where('que_status',1)
|
||||||
->where('que_class','>',99)
|
->where('que_class','>',99)
|
||||||
->orderByDesc('created_at')
|
->orderByDesc('created_at')
|
||||||
->limit(5)
|
->limit(5)
|
||||||
|
|||||||
@ -198,9 +198,58 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ページネーション -->
|
<!-- ページネーション -->
|
||||||
<div class="mt-2">
|
@php
|
||||||
{{ $jobs->links() }}
|
$paginator = $jobs;
|
||||||
|
$current = $paginator->currentPage();
|
||||||
|
$last = $paginator->lastPage();
|
||||||
|
$query = request()->except('page');
|
||||||
|
$pages = [];
|
||||||
|
if($last <= 20){
|
||||||
|
$pages = range(1,$last);
|
||||||
|
}else{
|
||||||
|
$pages[] = 1;
|
||||||
|
if($current > 4) $pages[] = '...L';
|
||||||
|
$windowStart = max(2, $current - 2);
|
||||||
|
$windowEnd = min($last-1, $current + 2);
|
||||||
|
for($i=$windowStart; $i<=$windowEnd; $i++){
|
||||||
|
$pages[] = $i;
|
||||||
|
}
|
||||||
|
if($current < $last - 3) $pages[] = '...R';
|
||||||
|
$pages[] = $last;
|
||||||
|
}
|
||||||
|
function pageUrl($page,$query){
|
||||||
|
return url()->current() . '?' . http_build_query(array_merge($query,['page'=>$page]));
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
@if($last > 1)
|
||||||
|
<div class="mt-2 d-flex justify-content-start">
|
||||||
|
<nav aria-label="ページネーション" class="custom-pagination">
|
||||||
|
<ul class="pagination pagination-sm mb-0">
|
||||||
|
<li class="page-item {{ $current==1?'disabled':'' }}">
|
||||||
|
<a class="page-link" href="{{ $current==1?'#':pageUrl(1,$query) }}">‹‹</a>
|
||||||
|
</li>
|
||||||
|
<li class="page-item {{ $current==1?'disabled':'' }}">
|
||||||
|
<a class="page-link" href="{{ $current==1?'#':pageUrl($current-1,$query) }}">‹</a>
|
||||||
|
</li>
|
||||||
|
@foreach($pages as $p)
|
||||||
|
@if(is_string($p) && str_starts_with($p,'...'))
|
||||||
|
<li class="page-item disabled"><span class="page-link">…</span></li>
|
||||||
|
@else
|
||||||
|
<li class="page-item {{ $p==$current?'active':'' }}">
|
||||||
|
<a class="page-link" href="{{ $p==$current?'#':pageUrl($p,$query) }}">{{ $p }}</a>
|
||||||
|
</li>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
<li class="page-item {{ $current==$last?'disabled':'' }}">
|
||||||
|
<a class="page-link" href="{{ $current==$last?'#':pageUrl($current+1,$query) }}">›</a>
|
||||||
|
</li>
|
||||||
|
<li class="page-item {{ $current==$last?'disabled':'' }}">
|
||||||
|
<a class="page-link" href="{{ $current==$last?'#':pageUrl($last,$query) }}">››</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -89,7 +89,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@foreach($latestHards as $hq)
|
@foreach($latestHards as $hq)
|
||||||
<a href="{{ route('information', ['type'=>'hard','status'=>'untreated']) }}" class="dropdown-item"
|
<a href="{{ route('information', ['type'=>'hard','status'=>'untreated','period'=>'all']) }}" class="dropdown-item"
|
||||||
style="white-space:normal;">
|
style="white-space:normal;">
|
||||||
{{ Str::limit($hq->que_comment ?? 'ハード異常', 40) }}
|
{{ Str::limit($hq->que_comment ?? 'ハード異常', 40) }}
|
||||||
<span class="float-right text-muted text-sm">
|
<span class="float-right text-muted text-sm">
|
||||||
@ -98,7 +98,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@endforeach
|
@endforeach
|
||||||
<a href="{{ route('information', ['type'=>'hard']) }}" class="dropdown-item dropdown-footer">
|
<a href="{{ route('information', ['type'=>'hard','period'=>'all']) }}" class="dropdown-item dropdown-footer">
|
||||||
すべてを見る
|
すべてを見る
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -124,7 +124,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@foreach($latestTasks as $tq)
|
@foreach($latestTasks as $tq)
|
||||||
<a href="{{ route('information', ['type'=>'task','status'=>'untreated']) }}" class="dropdown-item"
|
<a href="{{ route('information', ['type'=>'task','status'=>'untreated','period'=>'all']) }}" class="dropdown-item"
|
||||||
style="white-space:normal;">
|
style="white-space:normal;">
|
||||||
{{ Str::limit($tq->que_comment ?? 'タスク', 40) }}
|
{{ Str::limit($tq->que_comment ?? 'タスク', 40) }}
|
||||||
<span class="float-right text-muted text-sm">
|
<span class="float-right text-muted text-sm">
|
||||||
@ -133,7 +133,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@endforeach
|
@endforeach
|
||||||
<a href="{{ route('information', ['type'=>'task']) }}" class="dropdown-item dropdown-footer">
|
<a href="{{ route('information', ['type'=>'task','period'=>'all']) }}" class="dropdown-item dropdown-footer">
|
||||||
過去のタスクを全て見る
|
過去のタスクを全て見る
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user