Files
Socket/app/services/process/EndBetService.php
T
OG Backup 2cd31285f0 backup: 线上最终版本全量备份
包含所有线上运行的改动:
- 荷官端倒计时卡顿修复(CountdownService TTL+10/前端watchdog)
- 停止下注debounce防重复(8个handle.js)
- 洗码量规则重写(单边/双边/开和不计/百家乐+龙虎)
- 龙虎和局不杀庄闲(全额退回)
- 日志系统(Logger工具类/日志查看/清理脚本)
- 好路提醒异常处理(WaybillRemindService try-catch)
- 扫牌器连接改进(ScanConnectService)
- 牛牛/三卡开牌修复
- .gitignore更新/.DS_Store清理
2026-06-14 14:20:43 +08:00

51 lines
1.9 KiB
PHP

<?php
namespace app\services\process;
use app\models\process\NumberTab;
use app\services\connect\InitTableService;
use app\utils\Logger;
use freedom\utils\RedisUtil;
use freedom\utils\SocketSession;
/**
* TODO 结束倒计时
* Class EndBetService
* @package app\services\process
*/
class EndBetService
{
/**
* TODO 处理结束倒计时
* @param int $numberTabId
* @param array $tableInfo
* @return void
*/
public static function endBet(int $numberTabId, array $tableInfo){
$ws = app('\think\swoole\WebSocket');
$modelRes = NumberTab::endBet($numberTabId);
if ($modelRes['status'] == true){
$numberTabInfo = $modelRes['data'];
//清除Redis
RedisUtil::delete('countdown_'.$numberTabInfo['id']);
$ws->to(SocketSession::HOUSE_NAME)->emit('endBet',[
'status' => true,
'table_id' => $tableInfo['id'],
'round' => [
'boot_id' => $numberTabInfo['boot_id'],
'boot_num' => $numberTabInfo['boot_num'],
'number_tab_id' => $numberTabInfo['id'],
'number_tab_number' => $numberTabInfo['number'],
'in_checkout' => $tableInfo['in_checkout'],
'number_tab_status' => InitTableService::numberTabStatus($numberTabInfo)
]
]);
Logger::info(Logger::CAT_GAME, 'end_bet', ['table_id' => $tableInfo['id'], 'nt_id' => $numberTabId]);
}else{
Logger::warn(Logger::CAT_GAME, 'end_bet_fail', ['table_id' => $tableInfo['id'], 'msg' => $modelRes['msg'], 'bet_status' => $modelRes['bet_status'] ?? null]);
$ws->emit('endBet', ['status' => false, 'msg' => $modelRes['msg'], 'bet_status' => $modelRes['bet_status'] ?? null]);
}
}
}