add
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\services\scan;
|
||||
|
||||
|
||||
use app\models\process\NumberTab;
|
||||
use freedom\utils\RedisUtil;
|
||||
|
||||
/**
|
||||
* TODO 扫描登录公共处理类
|
||||
* Class ScanDtService
|
||||
* @package app\services\scan
|
||||
*/
|
||||
class ScanCommonService
|
||||
{
|
||||
/**
|
||||
* TODO 扫描公共验证方法
|
||||
* @param array $event
|
||||
* @param array $tableInfo
|
||||
* @return array
|
||||
*/
|
||||
public static function checkScan(array $event, array $tableInfo): array
|
||||
{
|
||||
if ($tableInfo['is_scavenging'] != 1) return ['status' => false, 'msg' => 'This Table Is Not Scan'];
|
||||
if (!isset($event['number_tab_id'])) return ['status' => false, 'msg' => 'Not NumberTabId'];
|
||||
$numberTabInfo = NumberTab::getByTableIdOrderByIdDesc($tableInfo);
|
||||
if (!$numberTabInfo) return ['status' => false, 'msg' => 'NumberTabId Error'];
|
||||
if ($numberTabInfo['bet_status'] != 2) return ['status' => false, 'msg' => 'BetStatus No 2'];
|
||||
//判断redis是否存在Card数据,如果不存在则创建
|
||||
if ($tableInfo['game_id'] == 1 || $tableInfo['game_id'] == 2){
|
||||
$cardInfo = RedisUtil::getCardPosition($numberTabInfo['id']);
|
||||
} else {
|
||||
$cardInfo = RedisUtil::getCard($numberTabInfo['id']);
|
||||
}
|
||||
return ['status' => true, 'numberTabInfo' => $numberTabInfo, 'cardInfo' => $cardInfo];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user