1.优化websocket中的jackpot.hit

This commit is contained in:
2026-05-28 17:28:51 +08:00
parent c49db7ca93
commit 3e5858bcce
2 changed files with 19 additions and 5 deletions

View File

@@ -763,11 +763,20 @@ final class GameBetSettleService
if ($userIds === []) {
return [];
}
$rows = Db::name('user')
->whereIn('id', $userIds)
->field(['id', 'nickname', 'username'])
->select()
->toArray();
// 兼容不同库结构:有的库没有 nickname 字段(仅 username
try {
$rows = Db::name('user')
->whereIn('id', $userIds)
->field(['id', 'nickname', 'username'])
->select()
->toArray();
} catch (Throwable) {
$rows = Db::name('user')
->whereIn('id', $userIds)
->field(['id', 'username'])
->select()
->toArray();
}
$out = [];
foreach ($rows as $row) {
$uid = isset($row['id']) && is_numeric($row['id']) ? (int) $row['id'] : 0;