商品列表问题
This commit is contained in:
@@ -58,7 +58,7 @@ public class GbWareController {
|
||||
if (param.getShopId() == null) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
}
|
||||
return CzgResult.success(wareService.getGbWarePage(param, param.getShopId()));
|
||||
return CzgResult.success(wareService.getGbWarePage(param, param.getShopId(), true));
|
||||
}
|
||||
|
||||
@PostMapping("/addGbWare")
|
||||
|
||||
@@ -52,7 +52,7 @@ public class UGbOrderController {
|
||||
param.setOnlineStatus(1);
|
||||
param.setWareName(wareName);
|
||||
param.setGroupPeopleNum(groupPeopleNum);
|
||||
Page<GbWare> data = wareService.getGbWarePage(param, shopId);
|
||||
Page<GbWare> data = wareService.getGbWarePage(param, shopId, false);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.mybatisflex.core.service.IService;
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
if (!isAdmin) {
|
||||
page.getRecords().forEach(item -> {
|
||||
item.setShopId(shopId);
|
||||
});
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user