统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -3,167 +3,175 @@
|
||||
@section('title', '老虎机历史记录')
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6">
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
{{-- 页头 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 flex justify-between items-center">
|
||||
@php
|
||||
$tableCellClass = 'px-4 py-3';
|
||||
$badgeClass = $adminListBadgeBaseClass;
|
||||
$resultLabels = [
|
||||
'jackpot' => ['label' => '🎉 三个7', 'color' => 'bg-yellow-100 text-yellow-700 border-yellow-200'],
|
||||
'triple_gem' => ['label' => '💎 三钻', 'color' => 'bg-blue-100 text-blue-700 border-blue-200'],
|
||||
'triple' => ['label' => '✨ 三同', 'color' => 'bg-green-100 text-green-700 border-green-200'],
|
||||
'pair' => ['label' => '🎁 两同', 'color' => 'bg-indigo-100 text-indigo-700 border-indigo-200'],
|
||||
'curse' => ['label' => '☠️ 三骷髅', 'color' => 'bg-red-100 text-red-700 border-red-200'],
|
||||
'miss' => ['label' => '😔 未中奖', 'color' => 'bg-gray-100 text-gray-600 border-gray-200'],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }} flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div>
|
||||
<h2 class="text-lg font-bold text-gray-800">🎰 老虎机历史记录</h2>
|
||||
<p class="text-xs text-gray-500 mt-1">查询所有玩家的老虎机转动记录,支持按结果类型和玩家名筛选。</p>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">🎰 老虎机历史记录</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">查询所有玩家的老虎机转动记录,支持按结果类型和玩家名筛选。</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.game-configs.index') }}"
|
||||
class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-bold hover:bg-gray-200 transition">
|
||||
<a href="{{ route('admin.game-configs.index') }}" class="{{ $adminListSecondaryButtonClass }}">
|
||||
⚙️ 游戏配置
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- 统计卡片 --}}
|
||||
<div class="grid grid-cols-2 md:grid-cols-5 gap-4">
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-5">
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-indigo-600">{{ number_format($summary['total_spins']) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">总转动次数</div>
|
||||
<div class="mt-1 text-xs text-gray-500">总转动次数</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-red-500">{{ number_format($summary['total_cost']) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">总消耗金币</div>
|
||||
<div class="mt-1 text-xs text-gray-500">总消耗金币</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-emerald-600">{{ number_format($summary['total_payout']) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">总派奖金币</div>
|
||||
<div class="mt-1 text-xs text-gray-500">总派奖金币</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-amber-600">{{ number_format($summary['net_income']) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">庄家净收(消耗-派奖)</div>
|
||||
<div class="mt-1 text-xs text-gray-500">庄家净收(消耗-派奖)</div>
|
||||
</div>
|
||||
<div class="bg-yellow-50 rounded-xl shadow-sm border border-yellow-100 p-5">
|
||||
<div class="text-2xl font-bold text-yellow-600">{{ number_format($summary['result_dist']['jackpot'] ?? 0) }}
|
||||
</div>
|
||||
<div class="text-xs text-yellow-500 mt-1">🎉 三7大奖次数</div>
|
||||
<div class="rounded-xl border border-yellow-100 bg-yellow-50 p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-yellow-600">{{ number_format($summary['result_dist']['jackpot'] ?? 0) }}</div>
|
||||
<div class="mt-1 text-xs text-yellow-500">🎉 三7大奖次数</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 结果分布 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="text-sm font-bold text-gray-700 mb-3">结果类型分布</div>
|
||||
<div class="flex flex-wrap gap-3">
|
||||
@php
|
||||
$resultLabels = [
|
||||
'jackpot' => ['label' => '🎉 三个7', 'color' => 'bg-yellow-100 text-yellow-700'],
|
||||
'triple_gem' => ['label' => '💎 三钻', 'color' => 'bg-blue-100 text-blue-700'],
|
||||
'triple' => ['label' => '✨ 三同', 'color' => 'bg-green-100 text-green-700'],
|
||||
'pair' => ['label' => '🎁 两同', 'color' => 'bg-indigo-100 text-indigo-700'],
|
||||
'curse' => ['label' => '☠️ 三骷髅', 'color' => 'bg-red-100 text-red-700'],
|
||||
'miss' => ['label' => '😔 未中奖', 'color' => 'bg-gray-100 text-gray-600'],
|
||||
];
|
||||
@endphp
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div class="{{ $adminListSectionTitleClass }}">结果类型分布</div>
|
||||
<div class="{{ $adminListSectionDescClass }}">保留中奖结果配色,仅统一卡片容器与排版节奏。</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-3 p-6">
|
||||
@foreach ($resultLabels as $key => $meta)
|
||||
<div class="px-4 py-2 rounded-lg {{ $meta['color'] }}">
|
||||
@php
|
||||
$distributionBorderClass = match ($key) {
|
||||
'jackpot' => 'border-yellow-200',
|
||||
'triple_gem' => 'border-blue-200',
|
||||
'triple' => 'border-green-200',
|
||||
'pair' => 'border-indigo-200',
|
||||
'curse' => 'border-red-200',
|
||||
default => 'border-gray-200',
|
||||
};
|
||||
@endphp
|
||||
<div class="rounded-lg border px-4 py-2 {{ $distributionBorderClass }} {{ $meta['color'] }}">
|
||||
<div class="text-sm font-bold">{{ $meta['label'] }}</div>
|
||||
<div class="text-xs mt-0.5">{{ number_format($summary['result_dist'][$key] ?? 0) }} 次</div>
|
||||
<div class="mt-0.5 text-xs">{{ number_format($summary['result_dist'][$key] ?? 0) }} 次</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 筛选条件 --}}
|
||||
<form method="GET"
|
||||
class="bg-white rounded-xl shadow-sm border border-gray-100 p-4 flex flex-wrap items-end gap-4">
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">结果类型</label>
|
||||
<select name="result_type"
|
||||
class="border border-gray-300 rounded-lg px-3 py-2 text-sm focus:border-indigo-400 min-w-[140px]">
|
||||
<option value="">全部结果</option>
|
||||
@foreach ($resultLabels as $key => $meta)
|
||||
<option value="{{ $key }}" {{ request('result_type') === $key ? 'selected' : '' }}>
|
||||
{{ $meta['label'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="{{ $adminListFilterCardClass }}">
|
||||
<div class="{{ $adminListFilterInnerClass }}">
|
||||
<form method="GET" class="{{ $adminListFilterFormClass }}">
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">结果类型</label>
|
||||
<select name="result_type" class="min-w-[140px] {{ $adminListFilterInputClass }}">
|
||||
<option value="">全部结果</option>
|
||||
@foreach ($resultLabels as $key => $meta)
|
||||
<option value="{{ $key }}" {{ request('result_type') === $key ? 'selected' : '' }}>
|
||||
{{ $meta['label'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">玩家名称</label>
|
||||
<input type="text" name="username" value="{{ request('username') }}" placeholder="模糊搜索..."
|
||||
class="w-40 {{ $adminListFilterInputClass }}">
|
||||
</div>
|
||||
<button type="submit" class="{{ $adminListPrimaryButtonClass }}">筛选</button>
|
||||
<a href="{{ route('admin.game-history.slot') }}" class="{{ $adminListSecondaryButtonClass }}">重置</a>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">玩家名称</label>
|
||||
<input type="text" name="username" value="{{ request('username') }}" placeholder="模糊搜索..."
|
||||
class="border border-gray-300 rounded-lg px-3 py-2 text-sm focus:border-indigo-400 w-40">
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button type="submit"
|
||||
class="px-5 py-2 bg-indigo-600 text-white rounded-lg font-bold hover:bg-indigo-700 transition text-sm">
|
||||
🔍 筛选
|
||||
</button>
|
||||
<a href="{{ route('admin.game-history.slot') }}"
|
||||
class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg font-bold hover:bg-gray-200 transition text-sm">
|
||||
重置
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- 记录列表 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left text-xs font-bold text-gray-500 uppercase">时间</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-bold text-gray-500 uppercase">玩家</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-bold text-gray-500 uppercase">三列图案</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-bold text-gray-500 uppercase">结果</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-bold text-gray-500 uppercase">消耗</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-bold text-gray-500 uppercase">获得</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-bold text-gray-500 uppercase">净值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
@forelse ($logs as $log)
|
||||
@php
|
||||
$symbols = \App\Models\SlotMachineLog::symbols();
|
||||
$r1Emoji = $symbols[$log->reel1]['emoji'] ?? $log->reel1;
|
||||
$r2Emoji = $symbols[$log->reel2]['emoji'] ?? $log->reel2;
|
||||
$r3Emoji = $symbols[$log->reel3]['emoji'] ?? $log->reel3;
|
||||
$net = $log->payout - $log->cost;
|
||||
$rowBg = match ($log->result_type) {
|
||||
'jackpot' => 'bg-yellow-50',
|
||||
'triple_gem' => 'bg-blue-50',
|
||||
'curse' => 'bg-red-50',
|
||||
default => '',
|
||||
};
|
||||
@endphp
|
||||
<tr class="hover:bg-gray-50 transition {{ $rowBg }}">
|
||||
<td class="px-4 py-3 text-xs text-gray-400">
|
||||
{{ $log->created_at->format('m-d H:i:s') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 font-medium text-gray-800">
|
||||
{{ $log->user?->username ?? '已注销' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-lg tracking-widest">
|
||||
{{ $r1Emoji }} {{ $r2Emoji }} {{ $r3Emoji }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold {{ $resultLabels[$log->result_type]['color'] ?? 'bg-gray-100 text-gray-600' }}">
|
||||
{{ $resultLabels[$log->result_type]['label'] ?? $log->result_type }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right font-mono text-xs text-red-500">
|
||||
-{{ number_format($log->cost) }}
|
||||
</td>
|
||||
<td
|
||||
class="px-4 py-3 text-right font-mono text-xs {{ $log->payout > 0 ? 'text-emerald-600 font-bold' : 'text-gray-400' }}">
|
||||
{{ $log->payout > 0 ? '+' . number_format($log->payout) : '0' }}
|
||||
</td>
|
||||
<td
|
||||
class="px-4 py-3 text-right font-mono text-xs {{ $net >= 0 ? 'text-emerald-600' : 'text-red-500' }} font-bold">
|
||||
{{ $net >= 0 ? '+' : '' }}{{ number_format($net) }}
|
||||
</td>
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div class="{{ $adminListSectionTitleClass }}">转动记录</div>
|
||||
<div class="{{ $adminListSectionDescClass }}">统一表格、空态和分页样式,保留高价值结果的行底色提示。</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead>
|
||||
<tr class="{{ $adminListTableHeadRowClass }}">
|
||||
<th class="{{ $adminListTableHeadCellClass }}">时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">玩家</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">三列图案</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">结果</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">消耗</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">获得</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">净值</th>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-10 text-center text-gray-400 text-sm">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($logs as $log)
|
||||
@php
|
||||
$symbols = \App\Models\SlotMachineLog::symbols();
|
||||
$r1Emoji = $symbols[$log->reel1]['emoji'] ?? $log->reel1;
|
||||
$r2Emoji = $symbols[$log->reel2]['emoji'] ?? $log->reel2;
|
||||
$r3Emoji = $symbols[$log->reel3]['emoji'] ?? $log->reel3;
|
||||
$net = $log->payout - $log->cost;
|
||||
$rowBg = match ($log->result_type) {
|
||||
'jackpot' => 'bg-yellow-50',
|
||||
'triple_gem' => 'bg-blue-50',
|
||||
'curse' => 'bg-red-50',
|
||||
default => '',
|
||||
};
|
||||
@endphp
|
||||
<tr class="{{ $adminListTableRowClass }} {{ $rowBg }}">
|
||||
<td class="{{ $tableCellClass }} {{ $adminListSecondaryTextClass }}">
|
||||
{{ $log->created_at->format('m-d H:i:s') }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} {{ $adminListPrimaryTextClass }}">
|
||||
{{ $log->user?->username ?? '已注销' }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center text-lg tracking-widest">
|
||||
{{ $r1Emoji }} {{ $r2Emoji }} {{ $r3Emoji }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center">
|
||||
<span class="{{ $badgeClass }} {{ $resultLabels[$log->result_type]['color'] ?? 'bg-gray-100 text-gray-600 border-gray-200' }}">
|
||||
{{ $resultLabels[$log->result_type]['label'] ?? $log->result_type }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} text-red-500">
|
||||
-{{ number_format($log->cost) }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} {{ $log->payout > 0 ? 'font-semibold text-emerald-600' : 'text-gray-400' }}">
|
||||
{{ $log->payout > 0 ? '+' . number_format($log->payout) : '0' }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} font-semibold {{ $net >= 0 ? 'text-emerald-600' : 'text-red-500' }}">
|
||||
{{ $net >= 0 ? '+' : '' }}{{ number_format($net) }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="{{ $adminListEmptyClass }}">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if ($logs->hasPages())
|
||||
<div class="px-4 py-3 border-t border-gray-100">
|
||||
<div class="{{ $adminListPaginationClass }}">
|
||||
{{ $logs->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user