优化/api/game/playStart接口
This commit is contained in:
@@ -71,11 +71,6 @@ class GameController extends OpenController
|
||||
{
|
||||
$userId = (int) ($request->player_id ?? 0);
|
||||
$direction = $request->post('direction');
|
||||
if (empty($direction)) {
|
||||
Log::error('传递的参数为direction = '.$direction);
|
||||
return $this->fail('请传递 direction 参数', ReturnCode::PARAMS_ERROR);
|
||||
}
|
||||
$direction = (int) $direction;
|
||||
if (!in_array($direction, [0, 1], true)) {
|
||||
return $this->fail('direction 必须为 0 或 1', ReturnCode::PARAMS_ERROR);
|
||||
}
|
||||
@@ -88,7 +83,7 @@ class GameController extends OpenController
|
||||
$minCoin = abs($minEv + 100);
|
||||
$coin = (float) $player->coin;
|
||||
if ($coin < $minCoin) {
|
||||
return $this->success([], '当前玩家余额小于DiceRewardConfigMin.real_ev+100无法继续游戏');
|
||||
return $this->success([], '当前玩家余额'.$coin.'小于'.$minCoin.'无法继续游戏');
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -52,7 +52,7 @@ class PlayStartLogic
|
||||
$minCoin = abs($minEv + self::MIN_COIN_EXTRA);
|
||||
$coin = (float) $player->coin;
|
||||
if ($coin < $minCoin) {
|
||||
throw new ApiException('当前玩家余额小于DiceRewardConfigMin.real_ev+100无法继续游戏');
|
||||
throw new ApiException('当前玩家余额'.$coin.'小于'.$minCoin.'无法继续游戏');
|
||||
}
|
||||
|
||||
$paid = (int) ($player->paid_ticket_count ?? 0);
|
||||
|
||||
Reference in New Issue
Block a user