商品列表问题

This commit is contained in:
2025-12-19 17:56:40 +08:00
parent 30b3da513b
commit 6084bf847b
4 changed files with 9 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ public class GbWareServiceImpl extends ServiceImpl<GbWareMapper, GbWare> impleme
@Override
public Page<GbWare> getGbWarePage(GbWareQueryParamDTO param, Long shopId) {
public Page<GbWare> getGbWarePage(GbWareQueryParamDTO param, Long shopId, boolean isAdmin) {
if (!shopInfoService.checkSwitch(shopId, ShopSwitchTypeEnum.GROUP_BUY)) {
return new Page<>();
}
@@ -53,9 +53,11 @@ public class GbWareServiceImpl extends ServiceImpl<GbWareMapper, GbWare> impleme
});
});
Page<GbWare> page = page(Page.of(param.getPage(), param.getSize()), queryWrapper);
page.getRecords().forEach(item -> {
item.setShopId(shopId);
});
if (!isAdmin) {
page.getRecords().forEach(item -> {
item.setShopId(shopId);
});
}
return page;
}