将项目中所有total_draw_count字段重构为total_ticket_count字段
将项目中所有paid_draw_count字段重构为paid_ticket_count字段 将项目中所有free_draw_count字段重构为free_ticket_count字段
This commit is contained in:
@@ -54,8 +54,8 @@ class PlayStartLogic
|
||||
throw new ApiException('当前玩家余额小于DiceRewardConfigMin.real_ev+100无法继续游戏');
|
||||
}
|
||||
|
||||
$paid = (int) ($player->paid_draw_count ?? 0);
|
||||
$free = (int) ($player->free_draw_count ?? 0);
|
||||
$paid = (int) ($player->paid_ticket_count ?? 0);
|
||||
$free = (int) ($player->free_ticket_count ?? 0);
|
||||
if ($paid + $free <= 0) {
|
||||
throw new ApiException('抽奖券不足');
|
||||
}
|
||||
@@ -125,21 +125,21 @@ class PlayStartLogic
|
||||
$coinBefore = (float) $p->coin;
|
||||
$coinAfter = $coinBefore + $winCoin;
|
||||
$p->coin = $coinAfter;
|
||||
$p->total_draw_count = max(0, (int) $p->total_draw_count - 1);
|
||||
$p->total_ticket_count = max(0, (int) $p->total_ticket_count - 1);
|
||||
if ($ticketType === self::LOTTERY_TYPE_PAID) {
|
||||
$p->paid_draw_count = max(0, (int) $p->paid_draw_count - 1);
|
||||
$p->paid_ticket_count = max(0, (int) $p->paid_ticket_count - 1);
|
||||
} else {
|
||||
$p->free_draw_count = max(0, (int) $p->free_draw_count - 1);
|
||||
$p->free_ticket_count = max(0, (int) $p->free_ticket_count - 1);
|
||||
}
|
||||
|
||||
// 若本局中奖档位为 T5,则额外赠送 1 次免费抽奖次数(总次数也 +1),并记录抽奖券获取记录
|
||||
if ($isTierT5) {
|
||||
$p->free_draw_count = (int) $p->free_draw_count + 1;
|
||||
$p->total_draw_count = (int) $p->total_draw_count + 1;
|
||||
$p->free_ticket_count = (int) $p->free_ticket_count + 1;
|
||||
$p->total_ticket_count = (int) $p->total_ticket_count + 1;
|
||||
|
||||
DicePlayerTicketRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'free_draw_count' => 1,
|
||||
'free_ticket_count' => 1,
|
||||
'remark' => '中奖结果为T5',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user