优化设计中奖T5获取抽奖券逻辑
This commit is contained in:
@@ -96,6 +96,14 @@ class GameController extends OpenController
|
||||
} catch (ApiException $e) {
|
||||
return $this->fail($e->getMessage(), ReturnCode::BUSINESS_ERROR);
|
||||
} catch (\Throwable $e) {
|
||||
// 记录抽奖逻辑抛出的真实异常,便于排查“服务超时,没有原因”
|
||||
Log::error('playStart 异常: ' . $e->getMessage(), [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
'player_id' => $userId,
|
||||
'direction' => $direction,
|
||||
]);
|
||||
$timeoutRecord = null;
|
||||
$timeout_message = '';
|
||||
try {
|
||||
@@ -104,6 +112,7 @@ class GameController extends OpenController
|
||||
'lottery_config_id' => 0,
|
||||
'lottery_type' => 0,
|
||||
'win_coin' => 0,
|
||||
'use_coins' => 0,
|
||||
'direction' => $direction,
|
||||
'reward_config_id' => 0,
|
||||
'start_index' => 0,
|
||||
@@ -111,13 +120,15 @@ class GameController extends OpenController
|
||||
'roll_array' => '[]',
|
||||
'status' => PlayStartLogic::RECORD_STATUS_TIMEOUT,
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
$timeout_message = $e->getMessage();
|
||||
Log::error("游玩记录写入超时: ". $e->getMessage());
|
||||
} catch (\Exception $inner) {
|
||||
$timeout_message = $inner->getMessage();
|
||||
Log::error('游玩记录写入超时: ' . $inner->getMessage());
|
||||
}
|
||||
|
||||
$payload = $timeoutRecord ? ['record' => $timeoutRecord->toArray()] : [];
|
||||
$msg = $timeout_message !== '' ? $timeout_message : '没有原因';
|
||||
$msg = $timeout_message !== '' ? $timeout_message : $e->getMessage();
|
||||
if ($msg === '') {
|
||||
$msg = '没有原因';
|
||||
}
|
||||
return $this->fail('服务超时,' . $msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ class PlayStartLogic
|
||||
'lottery_config_id' => $configId,
|
||||
'lottery_type' => $ticketType,
|
||||
'win_coin' => $winCoin,
|
||||
'use_coins' => 0,
|
||||
'direction' => $direction,
|
||||
'reward_config_id' => $rewardId,
|
||||
'start_index' => $startIndex,
|
||||
@@ -210,6 +211,7 @@ class PlayStartLogic
|
||||
'lottery_config_id' => $configId ?? 0,
|
||||
'lottery_type' => $ticketType,
|
||||
'win_coin' => 0,
|
||||
'use_coins' => 0,
|
||||
'direction' => $direction,
|
||||
'reward_config_id' => 0,
|
||||
'start_index' => $startIndex,
|
||||
|
||||
Reference in New Issue
Block a user