课程目录列表-配置购买人数

This commit is contained in:
wuchunlei
2024-06-11 15:20:28 +08:00
parent 2ac561f7c0
commit a4956714ab
2 changed files with 9 additions and 0 deletions

View File

@@ -55,4 +55,9 @@ public class CourseCatalogueEntity{
*/
@TableField(exist = false)
private List<ShopProduct> productList;
/**
* 购买人数
*/
@TableField(exist = false)
private int buyPeoples;
}

View File

@@ -44,6 +44,10 @@ public class CourseCatalogueServiceImpl extends ServiceImpl<CourseCatalogueDao,
shopProductCourseEntityMPJLambdaWrapper.eq(ShopProductCourseEntity::getCatalogueId,c.getId());
List<ShopProduct> shopProducts = shopProductCourseDao.selectJoinList(ShopProduct.class, shopProductCourseEntityMPJLambdaWrapper);
c.setProductList(shopProducts);
//配置购买人数
MPJLambdaWrapper<UserCourseBuyEntity> wrapper = new MPJLambdaWrapper<>();
wrapper.eq(UserCourseBuyEntity::getCatalogueId,c.getId());
c.setBuyPeoples(userCourseBuyDao.selectList(wrapper).size());
}
return list;
}