优化:百家乐押注面板显示押注人数,今日排行榜修正金币净收益统计
This commit is contained in:
@@ -136,9 +136,10 @@ class UserCurrencyService
|
||||
return UserCurrencyLog::query()
|
||||
->whereDate('created_at', $date)
|
||||
->where('currency', $currency)
|
||||
->where('amount', '>', 0) // 只统计正向
|
||||
// 计算净收益,包含正向与负向消耗
|
||||
->selectRaw('user_id, SUM(amount) as total')
|
||||
->groupBy('user_id')
|
||||
->havingRaw('SUM(amount) > 0') // 只有今日净收益为正数才能上榜
|
||||
->orderByRaw('SUM(amount) DESC')
|
||||
->limit($limit)
|
||||
->get()
|
||||
|
||||
Reference in New Issue
Block a user