From 6ffae79272b8558d2aef8e1b13234ce0de010ff0 Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Fri, 13 Jun 2025 17:53:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=9C=9F=E8=AF=BE=E7=A8=8B=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=86=8D=E6=AC=A1=E8=B4=AD=E4=B9=B0=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../psyche/controller/PsycheCourseController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/peanut/modules/psyche/controller/PsycheCourseController.java b/src/main/java/com/peanut/modules/psyche/controller/PsycheCourseController.java index d9889fdc..00f1d3cf 100644 --- a/src/main/java/com/peanut/modules/psyche/controller/PsycheCourseController.java +++ b/src/main/java/com/peanut/modules/psyche/controller/PsycheCourseController.java @@ -30,6 +30,8 @@ public class PsycheCourseController { private UserVipService userVipService; @Autowired private UserCourseStudyingService userCourseStudyingService; + @Autowired + private UserCourseBuyService userCourseBuyService; //我的课程-全部 @@ -88,7 +90,12 @@ public class PsycheCourseController { List> list = courseService.listMaps(wrapper); for (Map courseEntity : list) { if (!userVipService.isPsycheVip(ShiroUtils.getUId())){ - courseEntities.add(courseEntity); + int ucb = userCourseBuyService.count(new LambdaQueryWrapper() + .eq(UserCourseBuyEntity::getUserId,ShiroUtils.getUId()) + .eq(UserCourseBuyEntity::getCatalogueId,courseEntity.get("catalogueId"))); + if (ucb == 0) { + courseEntities.add(courseEntity); + } } } return R.ok().put("courseList",courseEntities);