feat: 世界杯48强夺冠盘、管理端调赔与项目文档
- 固定48强基准数据、同步种子与后台世界杯夺冠页 - 补全 user_preferences 迁移文件;新增启动指南与默认数据说明 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,6 +14,12 @@ import {
|
||||
toVenueJson,
|
||||
translationsFromZhiboNames,
|
||||
} from './zhibo-match.mapper';
|
||||
import { WC2026_OUTRIGHT_TEAMS } from './wc2026-outright-teams';
|
||||
|
||||
const WC2026_OUTRIGHT_RANK = new Map(
|
||||
WC2026_OUTRIGHT_TEAMS.map((t) => [t.code, t.rank]),
|
||||
);
|
||||
const WC2026_OUTRIGHT_CODES = new Set(WC2026_OUTRIGHT_TEAMS.map((t) => t.code));
|
||||
|
||||
@Injectable()
|
||||
export class MatchesService {
|
||||
@@ -586,22 +592,27 @@ export class MatchesService {
|
||||
const market = match.markets[0];
|
||||
if (!market) continue;
|
||||
|
||||
const selections = await Promise.all(
|
||||
market.selections.map(async (sel) => {
|
||||
const teamCode = sel.selectionCode.replace(/^TEAM_/, '');
|
||||
const team = await this.prisma.team.findUnique({ where: { code: teamCode } });
|
||||
const teamName = team
|
||||
? await this.getTranslation('TEAM', team.id, locale)
|
||||
: sel.selectionName;
|
||||
return {
|
||||
id: sel.id.toString(),
|
||||
teamCode,
|
||||
teamName,
|
||||
odds: sel.odds.toString(),
|
||||
oddsVersion: sel.oddsVersion.toString(),
|
||||
};
|
||||
}),
|
||||
);
|
||||
const selections = (
|
||||
await Promise.all(
|
||||
market.selections
|
||||
.filter((sel) => WC2026_OUTRIGHT_CODES.has(sel.selectionCode))
|
||||
.map(async (sel) => {
|
||||
const teamCode = sel.selectionCode.replace(/^TEAM_/, '');
|
||||
const team = await this.prisma.team.findUnique({ where: { code: teamCode } });
|
||||
const teamName = team
|
||||
? await this.getTranslation('TEAM', team.id, locale)
|
||||
: sel.selectionName;
|
||||
return {
|
||||
id: sel.id.toString(),
|
||||
teamCode,
|
||||
teamName,
|
||||
rank: WC2026_OUTRIGHT_RANK.get(teamCode) ?? 999,
|
||||
odds: sel.odds.toString(),
|
||||
oddsVersion: sel.oddsVersion.toString(),
|
||||
};
|
||||
}),
|
||||
)
|
||||
).sort((a, b) => a.rank - b.rank);
|
||||
|
||||
results.push({
|
||||
id: match.id.toString(),
|
||||
|
||||
Reference in New Issue
Block a user