优化:百家乐押注面板显示押注人数,今日排行榜修正金币净收益统计

This commit is contained in:
2026-03-28 17:38:59 +08:00
parent 63f9a174ed
commit 91b9a6bcef
2 changed files with 14 additions and 4 deletions
+2 -1
View File
@@ -136,9 +136,10 @@ class UserCurrencyService
return UserCurrencyLog::query() return UserCurrencyLog::query()
->whereDate('created_at', $date) ->whereDate('created_at', $date)
->where('currency', $currency) ->where('currency', $currency)
->where('amount', '>', 0) // 只统计正向 // 计算净收益,包含正向与负向消耗
->selectRaw('user_id, SUM(amount) as total') ->selectRaw('user_id, SUM(amount) as total')
->groupBy('user_id') ->groupBy('user_id')
->havingRaw('SUM(amount) > 0') // 只有今日净收益为正数才能上榜
->orderByRaw('SUM(amount) DESC') ->orderByRaw('SUM(amount) DESC')
->limit($limit) ->limit($limit)
->get() ->get()
@@ -81,19 +81,28 @@
<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:12px;"> <div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:12px;">
<div <div
style="background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; padding:8px; text-align:center;"> style="background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; padding:8px; text-align:center;">
<div style="color:#1d4ed8; font-size:11px; font-weight:bold;">押大</div> <div style="color:#1d4ed8; font-size:11px; font-weight:bold;">
押大
<span x-show="betCountBig > 0" x-text="'👤 ' + betCountBig" style="font-weight:normal; opacity:0.85; margin-left:2px;"></span>
</div>
<div style="color:#1e40af; font-weight:bold; font-size:13px;" <div style="color:#1e40af; font-weight:bold; font-size:13px;"
x-text="Number(totalBetBig).toLocaleString()"></div> x-text="Number(totalBetBig).toLocaleString()"></div>
</div> </div>
<div <div
style="background:#fffbeb; border:1px solid #fde68a; border-radius:8px; padding:8px; text-align:center;"> style="background:#fffbeb; border:1px solid #fde68a; border-radius:8px; padding:8px; text-align:center;">
<div style="color:#d97706; font-size:11px; font-weight:bold;">押小</div> <div style="color:#d97706; font-size:11px; font-weight:bold;">
押小
<span x-show="betCountSmall > 0" x-text="'👤 ' + betCountSmall" style="font-weight:normal; opacity:0.85; margin-left:2px;"></span>
</div>
<div style="color:#b45309; font-weight:bold; font-size:13px;" <div style="color:#b45309; font-weight:bold; font-size:13px;"
x-text="Number(totalBetSmall).toLocaleString()"></div> x-text="Number(totalBetSmall).toLocaleString()"></div>
</div> </div>
<div <div
style="background:#f5f3ff; border:1px solid #ddd6fe; border-radius:8px; padding:8px; text-align:center;"> style="background:#f5f3ff; border:1px solid #ddd6fe; border-radius:8px; padding:8px; text-align:center;">
<div style="color:#7c3aed; font-size:11px; font-weight:bold;">押豹子</div> <div style="color:#7c3aed; font-size:11px; font-weight:bold;">
押豹子
<span x-show="betCountTriple > 0" x-text="'👤 ' + betCountTriple" style="font-weight:normal; opacity:0.85; margin-left:2px;"></span>
</div>
<div style="color:#6d28d9; font-weight:bold; font-size:13px;" <div style="color:#6d28d9; font-weight:bold; font-size:13px;"
x-text="Number(totalBetTriple).toLocaleString()"></div> x-text="Number(totalBetTriple).toLocaleString()"></div>
</div> </div>