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-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
index f8f38b5..9f3cec6 100644
--- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
+++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
@@ -334,14 +334,14 @@
     public AppNearbyShopVo getNearbyShop(AppNearbyShopDto appNearbyShopDto,Member member){
         AppNearbyShopVo appNearbyShopVo = new AppNearbyShopVo();
         Shop shop = null;
-        if(member.getRelationShopId()!=null){
+        //获取附近商户
+        AppNearShopVo appNearShopVo = shopMapper.getNearbyShop(appNearbyShopDto);
+        shop = this.getById(appNearShopVo.getShopId());
+        if(member!=null&&member.getRelationShopId()!=null){
             //获取绑定商户
             shop = this.getById(member.getRelationShopId());
-        }else{
-            //获取附近商户
-            shop = this.getById(1L);
         }
-        if(member.getBindingFlag()!=1){
+        if(member!=null&&member.getBindingFlag()!=1){
             AppMemberBindingDto appMemberBindingDto = new AppMemberBindingDto();
             appMemberBindingDto.setShopId(shop.getShopId());
             appMemberBindingDto.setUserId(member.getUserId());
@@ -394,4 +394,6 @@
         List<MerAgencyPageVo> merAgencyPageVoList = shopMapper.pageMerAgencyVo(page, merAgencyPageDto);
         return merAgencyPageVoList;
     }
+
+
 }

--
Gitblit v1.7.1