商品列表问题

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

@@ -58,7 +58,7 @@ public class GbWareController {
if (param.getShopId() == null) { if (param.getShopId() == null) {
param.setShopId(StpKit.USER.getShopId()); param.setShopId(StpKit.USER.getShopId());
} }
return CzgResult.success(wareService.getGbWarePage(param, param.getShopId())); return CzgResult.success(wareService.getGbWarePage(param, param.getShopId(), true));
} }
@PostMapping("/addGbWare") @PostMapping("/addGbWare")

View File

@@ -52,7 +52,7 @@ public class UGbOrderController {
param.setOnlineStatus(1); param.setOnlineStatus(1);
param.setWareName(wareName); param.setWareName(wareName);
param.setGroupPeopleNum(groupPeopleNum); param.setGroupPeopleNum(groupPeopleNum);
Page<GbWare> data = wareService.getGbWarePage(param, shopId); Page<GbWare> data = wareService.getGbWarePage(param, shopId, false);
return CzgResult.success(data); return CzgResult.success(data);
} }

View File

@@ -15,7 +15,7 @@ import com.mybatisflex.core.service.IService;
public interface GbWareService extends IService<GbWare> { public interface GbWareService extends IService<GbWare> {
//拼团 活动 注意分店 主店的 问题 //拼团 活动 注意分店 主店的 问题
Page<GbWare> getGbWarePage(GbWareQueryParamDTO param, Long shopId); Page<GbWare> getGbWarePage(GbWareQueryParamDTO param, Long shopId, boolean isAdmin);
//添加 //添加
boolean addGbWare(GbWareDTO param); boolean addGbWare(GbWareDTO param);

View File

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