重新设置抽奖底注金额为1,优化页面样式

This commit is contained in:
2026-03-31 17:23:16 +08:00
parent d54a9c9281
commit 6ed34b97df
24 changed files with 118 additions and 94 deletions

View File

@@ -17,9 +17,9 @@ use support\think\Db;
class GameLogic
{
public const PACKAGES = [
1 => ['coin' => 100, 'paid' => 1, 'free' => 0], // 1次/100coin
5 => ['coin' => 500, 'paid' => 5, 'free' => 1], // 5张/500coin5购买+1赠送共6次
10 => ['coin' => 1000, 'paid' => 10, 'free' => 3], // 10张/1000coin10购买+3赠送共13次
1 => ['coin' => 1, 'paid' => 1, 'free' => 0], // 1次/1coin
5 => ['coin' => 5, 'paid' => 5, 'free' => 1], // 5张/5coin5购买+1赠送共6次
10 => ['coin' => 10, 'paid' => 10, 'free' => 3], // 10张/10coin10购买+3赠送共13次
];
/** 钱包流水类型:购买抽奖次数 */
@@ -52,7 +52,7 @@ class GameLogic
throw new ApiException('Insufficient balance');
}
$coinAfter = $coinBefore - $cost;
$coinAfter = round($coinBefore - $cost, 2);
$totalBefore = (int) ($player->total_ticket_count ?? 0);
$paidBefore = (int) ($player->paid_ticket_count ?? 0);
$freeBefore = (int) ($player->free_ticket_count ?? 0);
@@ -94,7 +94,7 @@ class GameLogic
DicePlayerWalletRecord::create([
'player_id' => $playerId,
'admin_id' => $adminId,
'coin' => -$cost,
'coin' => round(-$cost, 2),
'type' => self::WALLET_TYPE_BUY_DRAW,
'wallet_before' => $coinBefore,
'wallet_after' => $coinAfter,
@@ -107,7 +107,7 @@ class GameLogic
DicePlayerTicketRecord::create([
'player_id' => $playerId,
'admin_id' => $adminId,
'use_coins' => $cost,
'use_coins' => round($cost, 2),
'ante' => 1,
'total_ticket_count' => $addTotal,
'paid_ticket_count' => $addPaid,
@@ -121,7 +121,7 @@ class GameLogic
}
return [
'coin' => (float) $coinAfter,
'coin' => round((float) $coinAfter, 2),
'total_ticket_count' => (int) $totalAfter,
'paid_ticket_count' => (int) $paidAfter,
'free_ticket_count' => (int) $freeAfter,