1.优化玩家抽奖时没有记录dept_id的问题
This commit is contained in:
@@ -66,6 +66,9 @@ class PlayStartLogic
|
||||
}
|
||||
|
||||
$configDeptId = AdminScopeHelper::resolvePlayerConfigDeptId($player);
|
||||
$playerDeptId = isset($player->dept_id) && $player->dept_id !== null && $player->dept_id !== ''
|
||||
? (int) $player->dept_id
|
||||
: null;
|
||||
|
||||
$coin = (float) $player->coin;
|
||||
if ($ante <= 0) {
|
||||
@@ -270,6 +273,7 @@ class PlayStartLogic
|
||||
try {
|
||||
Db::transaction(function () use (
|
||||
$playerId,
|
||||
$playerDeptId,
|
||||
$adminId,
|
||||
$configId,
|
||||
$type0ConfigId,
|
||||
@@ -294,6 +298,7 @@ class PlayStartLogic
|
||||
$rewardTier = ($isWin === 1 && $superWinCoin > 0) ? 'BIGWIN' : (string) ($tier ?? '');
|
||||
$record = DicePlayRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId,
|
||||
'lottery_config_id' => $configId,
|
||||
'lottery_type' => $ticketType,
|
||||
@@ -357,6 +362,7 @@ class PlayStartLogic
|
||||
$freeCnt = $isPaidPlay ? 0 : 1;
|
||||
DicePlayerTicketRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId,
|
||||
'use_coins' => $paidAmount,
|
||||
'ante' => $ante,
|
||||
@@ -395,6 +401,7 @@ class PlayStartLogic
|
||||
|
||||
DicePlayerTicketRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId,
|
||||
'ante' => $ante,
|
||||
'free_ticket_count' => 1,
|
||||
@@ -441,6 +448,7 @@ class PlayStartLogic
|
||||
$walletAfterBuy = round($coinBefore - $paidAmount, 2);
|
||||
DicePlayerWalletRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId,
|
||||
'coin' => round(-$paidAmount, 2),
|
||||
'type' => self::WALLET_TYPE_BUY_DRAW,
|
||||
@@ -454,6 +462,7 @@ class PlayStartLogic
|
||||
$drawRemark = ($winCoin >= 0 ? '抽奖中奖' : '抽奖惩罚') . '|play_record_id=' . $record->id;
|
||||
DicePlayerWalletRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId,
|
||||
'coin' => $winCoin,
|
||||
'type' => self::WALLET_TYPE_DRAW,
|
||||
@@ -467,6 +476,7 @@ class PlayStartLogic
|
||||
try {
|
||||
$record = DicePlayRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId ?? null,
|
||||
'lottery_config_id' => $configId ?? 0,
|
||||
'lottery_type' => $ticketType,
|
||||
|
||||
Reference in New Issue
Block a user