1.优化玩家抽奖时没有记录dept_id的问题
This commit is contained in:
@@ -70,10 +70,14 @@ class GameLogic
|
||||
UserCache::setUser($playerId, $updatedUserArr);
|
||||
|
||||
$adminId = ($player->admin_id ?? null) ? (int) $player->admin_id : null;
|
||||
$playerDeptId = isset($player->dept_id) && $player->dept_id !== null && $player->dept_id !== ''
|
||||
? (int) $player->dept_id
|
||||
: null;
|
||||
try {
|
||||
Db::transaction(function () use (
|
||||
$player,
|
||||
$playerId,
|
||||
$playerDeptId,
|
||||
$adminId,
|
||||
$cost,
|
||||
$coinBefore,
|
||||
@@ -93,6 +97,7 @@ class GameLogic
|
||||
|
||||
DicePlayerWalletRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId,
|
||||
'coin' => round(-$cost, 2),
|
||||
'type' => self::WALLET_TYPE_BUY_DRAW,
|
||||
@@ -106,6 +111,7 @@ class GameLogic
|
||||
|
||||
DicePlayerTicketRecord::create([
|
||||
'player_id' => $playerId,
|
||||
'dept_id' => $playerDeptId,
|
||||
'admin_id' => $adminId,
|
||||
'use_coins' => round($cost, 2),
|
||||
'ante' => 1,
|
||||
|
||||
Reference in New Issue
Block a user