fix(player-desktop): 移除分类及标签的表情符号、修复首页快速下注缺少赔率数据及缺失翻译键的问题

This commit is contained in:
2026-06-30 17:50:38 +08:00
parent 178787e89a
commit 3df0dd8c2c
7 changed files with 39 additions and 11 deletions

View File

@@ -189,8 +189,8 @@ export class PlayerController {
const [banners, announcements, allMatches, upcomingMatches, inboxEnabled] = await Promise.all([
this.content.listActive('BANNER', locale),
this.content.listActiveAnnouncements(locale),
this.matches.listPublished(locale, undefined, { includeMarkets: false }),
this.matches.listUpcomingPublished(locale),
this.matches.listPublished(locale, undefined, { includeMarkets: true }),
this.matches.listUpcomingPublished(locale, { includeMarkets: true }),
this.systemConfig.getInboxFeatureEnabled(),
]);
const timeZone = safeTimeZone(headerTimeZone);

View File

@@ -1592,17 +1592,42 @@ export class MatchesService {
);
}
/** 首页卡片快速下注所需的核心玩法类型 */
private static readonly HOME_CARD_MARKET_TYPES = [
'FT_1X2',
'FT_HANDICAP',
'FT_OVER_UNDER',
] as const;
/** 未来 N 天内开赛的已发布赛事(按开赛时间升序,不限 isHot */
async listUpcomingPublished(
locale = 'en-US',
options?: { limit?: number; days?: number },
options?: { limit?: number; days?: number; includeMarkets?: boolean },
) {
const limit = options?.limit ?? 50;
const days = options?.days ?? 3;
const includeMarkets = options?.includeMarkets ?? false;
const now = new Date();
const end = new Date(now);
end.setDate(end.getDate() + days);
const marketsRelation = includeMarkets
? {
where: {
status: { in: ['OPEN', 'SUSPENDED', 'CLOSED'] },
showOnPlayer: true,
marketType: { in: [...MatchesService.HOME_CARD_MARKET_TYPES] },
},
include: {
selections: {
where: { status: { in: ['OPEN', 'SUSPENDED', 'CLOSED'] } },
orderBy: { sortOrder: 'asc' as const },
},
},
orderBy: { sortOrder: 'asc' as const },
}
: this.playerMarketStatusInclude;
const matches = await this.prisma.match.findMany({
where: {
status: { in: ['PUBLISHED', 'CLOSED', 'PENDING_SETTLEMENT'] },
@@ -1625,14 +1650,14 @@ export class MatchesService {
homeTeam: true,
awayTeam: true,
score: true,
markets: this.playerMarketStatusInclude,
markets: marketsRelation,
},
orderBy: [{ startTime: 'asc' }, { displayOrder: 'asc' }],
take: limit,
});
return Promise.all(
matches.map((m) => this.enrichMatch(m, locale, { omitMarkets: true })),
matches.map((m) => this.enrichMatch(m, locale, { omitMarkets: !includeMarkets })),
);
}