diff --git a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/AShopUserServiceImpl.java b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/AShopUserServiceImpl.java index dd007630b..a01325772 100644 --- a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/AShopUserServiceImpl.java +++ b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/AShopUserServiceImpl.java @@ -149,7 +149,8 @@ public class AShopUserServiceImpl implements AShopUserService { @Override public ShopUserSummaryDTO getSummary(Long shopId, Integer isVip) { - return shopUserMapper.selectUserSummary(shopId, isVip); + Long mainId = shopInfoService.getMainIdByShopId(shopId); + return shopUserMapper.selectUserSummary(mainId, isVip); } @Override diff --git a/cash-service/account-service/src/main/resources/mapper/ShopUserMapper.xml b/cash-service/account-service/src/main/resources/mapper/ShopUserMapper.xml index ed5c8ae56..43cb10b99 100644 --- a/cash-service/account-service/src/main/resources/mapper/ShopUserMapper.xml +++ b/cash-service/account-service/src/main/resources/mapper/ShopUserMapper.xml @@ -24,7 +24,7 @@ tb_shop_user as a left join tb_shop_user_flow as b on a.id=b.user_id and b.biz_code in ('cashIn', 'wechatIn', 'alipayIn') - where a.shop_id = #{shopId} + where a.main_shop_id = #{shopId} and a.is_vip=#{isVip} @@ -33,7 +33,7 @@ @@ -44,8 +44,7 @@ COUNT(DISTINCT c.id) AS couponNum FROM tb_shop_user AS b LEFT JOIN mk_shop_coupon_record AS c - ON c.shop_id = b.shop_id - AND c.shop_user_id = b.id + ON c.shop_user_id = b.id AND c.`status` = 1 AND c.use_start_time < NOW() AND c.use_end_time > NOW() @@ -112,7 +111,7 @@