重新设置抽奖底注金额为1,优化页面样式
This commit is contained in:
@@ -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张/500coin(5购买+1赠送,共6次)
|
||||
10 => ['coin' => 1000, 'paid' => 10, 'free' => 3], // 10张/1000coin(10购买+3赠送,共13次)
|
||||
1 => ['coin' => 1, 'paid' => 1, 'free' => 0], // 1次/1coin
|
||||
5 => ['coin' => 5, 'paid' => 5, 'free' => 1], // 5张/5coin(5购买+1赠送,共6次)
|
||||
10 => ['coin' => 10, 'paid' => 10, 'free' => 3], // 10张/10coin(10购买+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,
|
||||
|
||||
Reference in New Issue
Block a user