1.优化websocket中的jackpot.hit
This commit is contained in:
@@ -763,11 +763,20 @@ final class GameBetSettleService
|
|||||||
if ($userIds === []) {
|
if ($userIds === []) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
$rows = Db::name('user')
|
// 兼容不同库结构:有的库没有 nickname 字段(仅 username)
|
||||||
->whereIn('id', $userIds)
|
try {
|
||||||
->field(['id', 'nickname', 'username'])
|
$rows = Db::name('user')
|
||||||
->select()
|
->whereIn('id', $userIds)
|
||||||
->toArray();
|
->field(['id', 'nickname', 'username'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
} catch (Throwable) {
|
||||||
|
$rows = Db::name('user')
|
||||||
|
->whereIn('id', $userIds)
|
||||||
|
->field(['id', 'username'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
$out = [];
|
$out = [];
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$uid = isset($row['id']) && is_numeric($row['id']) ? (int) $row['id'] : 0;
|
$uid = isset($row['id']) && is_numeric($row['id']) ? (int) $row['id'] : 0;
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ if ($periodId <= 0 && isset($opts['period-no'])) {
|
|||||||
if ($periodNo !== '') {
|
if ($periodNo !== '') {
|
||||||
$pid = Db::name('game_record')->where('period_no', $periodNo)->value('id');
|
$pid = Db::name('game_record')->where('period_no', $periodNo)->value('id');
|
||||||
$periodId = is_numeric((string) $pid) ? (int) $pid : 0;
|
$periodId = is_numeric((string) $pid) ? (int) $pid : 0;
|
||||||
|
if ($periodId <= 0) {
|
||||||
|
// 兜底:部分环境 game_record.period_no 与 bet_order.period_no 不一致(或 game_record 未落库),从注单反查 period_id
|
||||||
|
$pid2 = Db::name('bet_order')->where('period_no', $periodNo)->value('period_id');
|
||||||
|
$periodId = is_numeric((string) $pid2) ? (int) $pid2 : 0;
|
||||||
|
}
|
||||||
echo "period_no={$periodNo} => period_id={$periodId}" . PHP_EOL;
|
echo "period_no={$periodNo} => period_id={$periodId}" . PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user