{{-- Task #33882 — チャーンレート (Churn rate) — SCR-02 (read-only analytics, System Admin / 売上データ). Giao diện lấy từ branch 33882 (layout/CSS/HTML), wire AJAX thật tới EP-02: GET route('churnRateData') (?view=overall|by_channel ...). Backend (Controller → Service → Repository) giữ nguyên của branch hiện tại. --}} @extends('layout.admin_v2.main') @section('title', 'チャーンレート') @push('css') @endpush @section('content')
チャーンレート
{{-- ===== TOOLBAR ===== --}}
{{-- Default view: year navigation --}}
@{{ currentYear }}年
{{-- By-route view: month navigation + display-item dropdown --}}
@{{ currentYear }}年@{{ currentMonth }}月
{{-- 表示する項目 dropdown (options động theo path intro từ API) --}}
@{{ truncateLabel(opt.label) }}
{{-- View switch button --}}
{{-- ===== ERROR STATE (5xx/network) + 再試行 ===== --}}

@{{ error }}

{{-- ===== DEFAULT TABLE (yearly, grouped 2-row header) ===== --}}
{{-- Totals row (BR-12) --}} {{-- Monthly rows --}}
月 解約率 前月末の有料アカウント数 当月末の解約数
合計 @{{ label }} @{{ label }}
合計数 @{{ formatRate(totalRow.rate) }} @{{ formatNum(val) }} @{{ formatNum(val) }}
@{{ row.month }} @{{ formatRate(row.rate) }} @{{ formatNum(val) }} @{{ formatNum(val) }}
{{-- ===== BY-ROUTE TABLE (daily, per registration route — filter by 表示する項目) ===== --}}
{{-- Mỗi nhóm 経路 rộng 240px (2 sub-col × 120px); tên dài → cắt 20 ký tự + '…', full text ở tooltip --}} {{-- Totals row --}} {{-- Daily rows --}}
登録経路 @{{ truncateLabel(rt.name) }}
合計数
@{{ row.label }}
@endsection @push('script') @endpush