From 524c8ed6f37e8e586d5456b52f2f1b758721b655 Mon Sep 17 00:00:00 2001 From: pllx Date: Tue, 30 Jun 2026 14:12:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=BB=BA=E5=89=8D=E5=8F=B0?= =?UTF-8?q?=E7=99=BE=E5=AE=B6=E4=B9=90=E5=8E=86=E5=8F=B2=E8=B5=B0=E5=8A=BF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8E=E7=8F=A0=E7=9B=98=E8=B7=AF=EF=BC=8C?= =?UTF-8?q?=E6=89=93=E9=80=9A=E5=A4=A7=E5=8E=85=E4=B8=8E=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=A0=8F=E5=BF=AB=E6=8D=B7=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/BaccaratController.php | 24 ++ resources/views/layouts/app.blade.php | 8 + .../views/rooms/baccarat-history.blade.php | 239 ++++++++++++++++++ resources/views/rooms/index.blade.php | 19 +- routes/web.php | 1 + 5 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 resources/views/rooms/baccarat-history.blade.php diff --git a/app/Http/Controllers/BaccaratController.php b/app/Http/Controllers/BaccaratController.php index ffa5e3a..1566874 100644 --- a/app/Http/Controllers/BaccaratController.php +++ b/app/Http/Controllers/BaccaratController.php @@ -235,4 +235,28 @@ class BaccaratController extends Controller return response()->json(['history' => $rounds]); } + + /** + * 前台百家乐历史走势与开奖页面。 + */ + public function historyPage(Request $request): \Illuminate\View\View + { + // 1. 各选项的历史分布统计 + $summary = [ + 'total_rounds' => BaccaratRound::query()->where('status', 'settled')->count(), + 'result_dist' => BaccaratRound::query() + ->where('status', 'settled') + ->select('result', \Illuminate\Support\Facades\DB::raw('count(*) as cnt')) + ->groupBy('result') + ->pluck('cnt', 'result'), + ]; + + // 2. 分页拉取所有已结算的局次 + $rounds = BaccaratRound::query() + ->where('status', 'settled') + ->orderByDesc('id') + ->paginate(30); + + return view('rooms.baccarat-history', compact('rounds', 'summary')); + } } diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 64aff0b..e467249 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -91,6 +91,10 @@ class="text-indigo-200 hover:text-white font-bold flex items-center transition hidden sm:flex"> 大厅 + + + 🎲 百家乐 + 邀请排行 diff --git a/resources/views/rooms/baccarat-history.blade.php b/resources/views/rooms/baccarat-history.blade.php new file mode 100644 index 0000000..f5aa544 --- /dev/null +++ b/resources/views/rooms/baccarat-history.blade.php @@ -0,0 +1,239 @@ +@extends('layouts.app') + +@section('title', '百家乐开奖走势 - 飘落流星') + +@section('head') + +@endsection + +@section('content') +
+
+ + {{-- 顶部标题与返回 --}} + + + {{-- 统计指标卡片组 --}} +
+
+
{{ number_format($summary['total_rounds']) }}
+
历史总局数
+
+ + @php + $dist = $summary['result_dist']; + $total = max(1, $summary['total_rounds']); + $bigPercent = round((($dist['big'] ?? 0) / $total) * 100, 1); + $smallPercent = round((($dist['small'] ?? 0) / $total) * 100, 1); + $triplePercent = round((($dist['triple'] ?? 0) / $total) * 100, 1); + $killPercent = round((($dist['kill'] ?? 0) / $total) * 100, 1); + @endphp + +
+
{{ $bigPercent }}%
+
+ 开大比例 + {{ $dist['big'] ?? 0 }} 局 +
+
+ +
+
{{ $smallPercent }}%
+
+ 开小比例 + {{ $dist['small'] ?? 0 }} 局 +
+
+ +
+
{{ $triplePercent }}%
+
+ 开豹比例 + {{ $dist['triple'] ?? 0 }} 局 +
+
+ +
+
{{ $killPercent }}%
+
+ 开收割比例 + {{ $dist['kill'] ?? 0 }} 局 +
+
+
+ + {{-- 珠盘路大趋势走势图 --}} +
+
+

+ 📊 珠盘路走势板(最近 30 局) +

+ 从左往右为历史开奖顺序 +
+ +
+ @forelse($rounds->take(30)->reverse() as $r) +
+ #{{ $r->id }} + + @php + $colorClass = match ($r->result) { + 'big' => 'bg-gradient-to-br from-red-500 to-red-600 text-white shadow-red-500/20 border-red-400', + 'small' => 'bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-blue-500/20 border-blue-400', + 'triple' => 'bg-gradient-to-br from-purple-500 to-purple-600 text-white shadow-purple-500/20 border-purple-400', + default => 'bg-gradient-to-br from-gray-600 to-gray-700 text-gray-200 border-gray-500', + }; + $label = match ($r->result) { + 'big' => '大', + 'small' => '小', + 'triple' => '豹', + default => '割', + }; + @endphp + +
+ {{ $label }} +
+ + {{ $r->total_points }} 点 +
+ @empty +
暂无走势数据
+ @endforelse +
+
+ + {{-- 历史记录数据表 --}} +
+
+

百家乐局次历史记录

+ 仅展示已结算局次数据 +
+ +
+ + + + + + + + + + + + + + @forelse ($rounds as $round) + + + + + + + + + + @empty + + + + @endforelse + +
局号结算时间骰子开出总点数开奖结果全场总押注全场派奖金币
#{{ $round->id }} + {{ $round->settled_at ? $round->settled_at->format('m-d H:i') : '—' }} + +
+ @for ($i = 1; $i <= 3; $i++) + @php $diceVal = $round->{'dice'.$i}; @endphp + @if ($diceVal) + + {{ $diceVal }} + + @else + + @endif + @endfor +
+
+ {{ $round->total_points ?? '—' }} + + @php + $resultStyles = [ + 'big' => 'bg-red-950/50 text-red-400 border-red-800/60', + 'small' => 'bg-blue-950/50 text-blue-400 border-blue-800/60', + 'triple' => 'bg-purple-950/50 text-purple-400 border-purple-800/60', + 'kill' => 'bg-gray-900 text-gray-500 border-gray-800', + ]; + $labelText = match ($round->result) { + 'big' => '大', + 'small' => '小', + 'triple' => '豹子', + 'kill' => '收割', + default => $round->result ?? '—', + }; + $borderStyle = $resultStyles[$round->result] ?? 'bg-gray-900 text-gray-500 border-gray-800'; + @endphp + @if ($round->result) + + {{ $labelText }} + + @else + 未结算 + @endif + +
+ + {{ number_format(($round->total_bet_big ?? 0) + ($round->total_bet_small ?? 0) + ($round->total_bet_triple ?? 0)) }} + + + 大:{{ number_format($round->total_bet_big ?? 0) }} | + 小:{{ number_format($round->total_bet_small ?? 0) }} | + 豹:{{ number_format($round->total_bet_triple ?? 0) }} + +
+
+ {{ number_format($round->total_payout ?? 0) }} +
+

暂无开奖记录

+
+
+ + {{-- 分页器美化 --}} + @if ($rounds->hasPages()) +
+ {{-- Laravel 默认分页器兼容 --}} +
+ {{ $rounds->links() }} +
+
+ @endif +
+ +
+
+@endsection diff --git a/resources/views/rooms/index.blade.php b/resources/views/rooms/index.blade.php index d1cb9f3..0cc039c 100644 --- a/resources/views/rooms/index.blade.php +++ b/resources/views/rooms/index.blade.php @@ -60,9 +60,24 @@
-
-

公开频段 ({{ $rooms->count() }}) +
+

+ 公开频段 ({{ $rooms->count() }})

+
+ + 🎲 百家乐开奖走势 + + + +
{{-- 房间瀑布流网格 --}} diff --git a/routes/web.php b/routes/web.php index 4df85e9..43fcb65 100644 --- a/routes/web.php +++ b/routes/web.php @@ -170,6 +170,7 @@ Route::middleware(['chat.auth'])->group(function () { Route::get('/current', [\App\Http\Controllers\BaccaratController::class, 'currentRound'])->name('current'); Route::post('/bet', [\App\Http\Controllers\BaccaratController::class, 'bet'])->name('bet'); Route::get('/history', [\App\Http\Controllers\BaccaratController::class, 'history'])->name('history'); + Route::get('/history-page', [\App\Http\Controllers\BaccaratController::class, 'historyPage'])->name('history-page'); }); // ── 百家乐买单活动(前台)───────────────────────────────────────