fix: 更新任务调度频率并增强错误处理逻辑

- 将 `lottery:draw-tick` 命令的调度频率从每分钟更新为每10秒,以提高抽奖数据处理的及时性。
- 在 `AdminSettlementBatchPayoutController` 中增强异常处理,提供更具体的错误信息,特别是针对未批准的结算批次。
- 在多语言文件中添加相应的错误信息翻译,确保用户友好的反馈。
This commit is contained in:
2026-05-25 16:43:51 +08:00
parent 5f1d2d79ce
commit 770fd8950d
6 changed files with 14 additions and 4 deletions

View File

@@ -17,8 +17,14 @@ final class AdminSettlementBatchPayoutController extends Controller
{
try {
$updated = $this->service->payout($batch);
} catch (\RuntimeException) {
return ApiResponse::error(trans('api.client_error'), ErrorCode::ClientHttpError->value, null, 409);
} catch (\RuntimeException $e) {
$reason = $e->getMessage();
$msg = match ($reason) {
'settlement_not_approved' => trans('api.settlement_not_approved'),
default => trans('api.client_error'),
};
return ApiResponse::error($msg, ErrorCode::ClientHttpError->value, ['reason' => $reason], 409);
}
return ApiResponse::success([