修复扫牌器获取的 boot_id是旧数据的问题,导致下注等异常
This commit is contained in:
@@ -8,6 +8,7 @@ use app\models\bet\Bet;
|
|||||||
use app\models\process\NumberTab;
|
use app\models\process\NumberTab;
|
||||||
use app\models\user\User;
|
use app\models\user\User;
|
||||||
use app\models\user\Session;
|
use app\models\user\Session;
|
||||||
|
use app\services\connect\InitTableService;
|
||||||
|
|
||||||
class ToBetCommonService
|
class ToBetCommonService
|
||||||
{
|
{
|
||||||
@@ -39,7 +40,8 @@ class ToBetCommonService
|
|||||||
return ['status' => false, 'msg' => 'to_bet_fail_10'];
|
return ['status' => false, 'msg' => 'to_bet_fail_10'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$numberTabInfo = NumberTab::getByTableIdOrderByIdDesc($tableInfo);
|
// 使用 InitTableService::initTable 获取当前靴的最新一局,与其他服务保持一致
|
||||||
|
$numberTabInfo = InitTableService::initTable($tableInfo);
|
||||||
if ($numberTabInfo['id'] != $numberTabId){
|
if ($numberTabInfo['id'] != $numberTabId){
|
||||||
return ['status' => false, 'msg' => 'to_bet_fail_5'];
|
return ['status' => false, 'msg' => 'to_bet_fail_5'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,49 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace app\services\connect;
|
namespace app\services\connect;
|
||||||
|
|
||||||
|
|
||||||
use app\models\process\NumberTab;
|
use app\models\process\NumberTab;
|
||||||
use app\models\table\Table;
|
use app\models\table\Table;
|
||||||
use freedom\utils\SocketSession;
|
use freedom\utils\SocketSession;
|
||||||
use think\Request;
|
use think\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 扫描登录服务
|
* TODO 扫描登录服务
|
||||||
* Class SpaceConnectService
|
* Class SpaceConnectService
|
||||||
* @package app\services\connect
|
* @package app\services\connect
|
||||||
*/
|
*/
|
||||||
class ScanConnectService
|
class ScanConnectService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* TODO 控制台登录处理
|
* TODO 控制台登录处理
|
||||||
* @param Request $event
|
* @param Request $event
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function doScanConnect(Request $event){
|
public static function doScanConnect(Request $event){
|
||||||
$ws = app('\think\swoole\WebSocket');
|
$ws = app('\think\swoole\WebSocket');
|
||||||
$tableId = intval($event->get('table_id'));
|
$tableId = intval($event->get('table_id'));
|
||||||
$tableInfo = Table::get($tableId);
|
$tableInfo = Table::get($tableId);
|
||||||
$numberTabInfo = NumberTab::getByTableIdOrderByIdDesc($tableInfo);
|
// 使用 InitTableService::initTable 获取当前靴的最新一局,与其他服务保持一致
|
||||||
if (!$numberTabInfo){
|
$numberTabInfo = InitTableService::initTable($tableInfo);
|
||||||
$ws->emit('onlineLogin',['status' => false, 'msg' => 'Not NumberTab Data']);
|
if (!$numberTabInfo){
|
||||||
$ws->close();
|
$ws->emit('onlineLogin',['status' => false, 'msg' => 'Not NumberTab Data']);
|
||||||
return;
|
$ws->close();
|
||||||
}
|
return;
|
||||||
$round = array();
|
}
|
||||||
$round['tid'] = $tableId;
|
$round = array();
|
||||||
$round['boot_id'] = intval($numberTabInfo['boot_id']);
|
$round['tid'] = $tableId;
|
||||||
$round['boot_num'] = intval($numberTabInfo['boot_num']);
|
$round['boot_id'] = intval($numberTabInfo['boot_id']);
|
||||||
$round['number_tab_id'] = intval($numberTabInfo['id']);
|
$round['boot_num'] = intval($numberTabInfo['boot_num']);
|
||||||
$round['number_tab_number'] = intval($numberTabInfo['number']);
|
$round['number_tab_id'] = intval($numberTabInfo['id']);
|
||||||
if ($numberTabInfo['bet_status'] == 2){
|
$round['number_tab_number'] = intval($numberTabInfo['number']);
|
||||||
$round['is_scan'] = true;
|
if ($numberTabInfo['bet_status'] == 2){
|
||||||
}else{
|
$round['is_scan'] = true;
|
||||||
$round['is_scan'] = false;
|
}else{
|
||||||
}
|
$round['is_scan'] = false;
|
||||||
$ws->join(SocketSession::HOUSE_NAME);
|
}
|
||||||
$ws->emit('onlineLogin',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
|
$ws->join(SocketSession::HOUSE_NAME);
|
||||||
}
|
$ws->emit('onlineLogin',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user