Jelajahi Sumber

游戏税收配置增加每日税收、rtp、中奖率

laowu 1 hari lalu
induk
melakukan
8fa20755df

+ 24 - 1
app/Http/Controllers/Admin/StockModeController.php

@@ -32,12 +32,35 @@ class StockModeController extends Controller
             ->where('GameID', 0)
             ->orderBy('SortID')
             ->get();
+        // 今日税收 rtp 中间率
+        $todayID = date('Ymd');
+
+        $gameRoom = DB::connection('read')
+            ->table('QPPlatformDB.dbo.GameRoomInfo')
+            ->select('RevenueRatio')
+            ->first();
+        // 将千分比转换为百分比显示(例如:50 -> 5%)
+        $revenueRatio = $gameRoom ? ($gameRoom->RevenueRatio / 10) : 0;
+
+        $rst2 = DB::Table('QPPlatformDB.dbo.RoomStockDay2')
+            ->lock('with(nolock)')
+            ->selectRaw('SUM(Winlost) as SumWinlost, SUM(Turnover) as SumTurnover')
+            ->groupBy('SortID')
+            ->where('DateID', $todayID)
+            ->get();
+        foreach ($rst2 as $k => $v) {
+            $rst2[$k]->todayRevenue = $v->SumTurnover*$revenueRatio/100;
+            $rst2[$k]->todayRtp = round($v->SumWinlost/$v->SumTurnover, 4);
+            $rst2[$k]->todayWinRatio = 0; // today 获取中奖率并赋值
+        }
+        $rst2 = $rst2->keyBy('SortID');
 
         return view('admin.stock_mode.index', compact(
             'systemConfig',
             'betMaxLimits',
             'rechargeMinLimits',
-            'roomStocks'
+            'roomStocks',
+            'rst2'
         ));
     }
 

+ 9 - 4
resources/views/admin/stock_mode/index.blade.php

@@ -195,7 +195,9 @@
                                                 <th>当前库存 (Stock)</th>
                                                 <th>基数 (LevelBase)</th>
                                                 <th>累计税收 (Revenue)</th>
-                                                <th>累计暗税 (RevenueD)</th>
+                                                <th>今日税收</th>
+                                                <th>今日rtp</th>
+                                                <th>中奖率</th>
                                                 <th width="120">操作</th>
                                             </tr>
                                         </thead>
@@ -207,6 +209,9 @@
                                                     $levelBase = ($roomStock->LevelBase ?? 10000) / 100;
                                                     $revenue = ($roomStock->Revenue ?? 0) / 100;
                                                     $revenueD = ($roomStock->RevenueD ?? 0) / 100;
+                                                    $todayRevenue = ($rst2[$sortId]->todayRevenue ?? 0) / 100;
+                                                    $todayRtp = ($rst2[$sortId]->todayRtp ?? 0);
+                                                    $todayWinRatio = ($rst2[$sortId]->todayWinRatio ?? 0) * 100;
                                                 @endphp
                                                 <tr>
                                                     <td>
@@ -241,9 +246,9 @@
                                                     <td class="text-right text-muted">
                                                         {{ number_format($revenue, 2) }}
                                                     </td>
-                                                    <td class="text-right text-muted">
-                                                        {{ number_format($revenueD, 2) }}
-                                                    </td>
+                                                    <td class="text-right text-muted">{{ $todayRevenue }}</td>
+                                                    <td class="text-right text-muted">{{ $todayRtp }}</td>
+                                                    <td class="text-right text-muted">{{ $todayWinRatio }} %</td>
                                                     <td class="text-center">
                                                         <button class="btn btn-sm btn-primary save-room-stock" data-sort-id="{{ $sortId }}">
                                                             <i class="mdi mdi-content-save"></i> 保存