From 038c865e6dc74fa37a2abf0339174998dd2d2361 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Thu, 7 Aug 2025 11:11:42 +0800 Subject: [PATCH] dd --- WeChatApplet/Services/Impl/ClientSideService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/WeChatApplet/Services/Impl/ClientSideService.cs b/WeChatApplet/Services/Impl/ClientSideService.cs index 96b6fc1..09bf541 100644 --- a/WeChatApplet/Services/Impl/ClientSideService.cs +++ b/WeChatApplet/Services/Impl/ClientSideService.cs @@ -170,9 +170,17 @@ namespace YD_WeChatApplet.Api.Services.Impl .Select(x => x.TaxonomyId) .ToListAsync(); + var codeToTypeMap = new Dictionary + { + { "YD-1001", 1 }, + { "YD-2001", 2 } + }; + + codeToTypeMap.TryGetValue(redeemCode, out int curricularType); + // 获取所有类型为2的课程 var paidCourses = await _sportsContext.CurricularTaxonomy - .Where(x => x.CurricularType == 2) + .Where(x => x.CurricularType == curricularType) .ToListAsync(); // 找出用户未购买的课程