获取标签下得商品书列表

This commit is contained in:
wuchunlei
2024-05-16 13:21:37 +08:00
parent 1b3803074d
commit e616be7687
3 changed files with 30 additions and 0 deletions

View File

@@ -352,7 +352,33 @@ public class BookLabelAndMarketController {
return R.ok();
}
/**
* 获取分类标签下得商品列表
*/
@RequestMapping("/getShopProductListByLabelId")
public R getShopProductListByLabelId(String labelId){
MPJLambdaWrapper<ShopProductToBookLabel> wrapper = new MPJLambdaWrapper();
wrapper.eq(ShopProductToBookLabel::getBookLabelId,labelId);
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopProductToBookLabel::getProductId);
wrapper.selectAll(ShopProduct.class);
wrapper.orderByAsc(ShopProductToBookLabel::getSort);
List list = toLabelService.listMaps(wrapper);
return R.ok().put("result", list);
}
/**
* 获取营销标签下得商品列表
*/
@RequestMapping("/getShopProductListByMarketId")
public R getShopProductListByMarketId(String marketId){
MPJLambdaWrapper<ShopProductToBookMarket> wrapper = new MPJLambdaWrapper();
wrapper.eq(ShopProductToBookMarket::getBookMarketId,marketId);
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopProductToBookMarket::getProductId);
wrapper.selectAll(ShopProduct.class);
wrapper.orderByAsc(ShopProductToBookMarket::getSort);
List list = toMarketService.listMaps(wrapper);
return R.ok().put("result", list);
}