From 5f159dab33dce77f05472b16045ab6ca4f48d07b Mon Sep 17 00:00:00 2001 From: jiangqs <jiangqs> Date: 星期五, 12 五月 2023 16:49:39 +0800 Subject: [PATCH] DEMO完成 --- ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/AppGoodsController.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/AppGoodsController.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/AppGoodsController.java index 0645b43..676834d 100644 --- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/AppGoodsController.java +++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/AppGoodsController.java @@ -53,6 +53,8 @@ Member member = memberService.getMember(userId).getData(); if(member!=null&&member.getRelationShopId()!=null){ appGoodsInfoGetDto.setShopId(member.getRelationShopId()); + }else{ + appGoodsInfoGetDto.setShopId(1L); } } AppGoodsInfoVo appGoodsInfoVo = goodsService.getGoodsInfo(appGoodsInfoGetDto); @@ -73,7 +75,7 @@ @ApiOperation(value = "添加购物车") public R addShoppingCart(@RequestBody AppShoppingCartAddDto appShoppingCartAddDto) { Long userId = SecurityUtils.getUserId(); - if(userId!=null){ + if(userId != null){ Member member = memberService.getMember(userId).getData(); appShoppingCartAddDto.setUserId(userId); if(appShoppingCartAddDto.getShopId()==null&&member!=null&&member.getRelationShopId()!=null){ -- Gitblit v1.7.1