店铺会员查询修改

This commit is contained in:
张松 2025-09-27 14:41:38 +08:00
parent ac8d11bea7
commit 8fc90285fe
1 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,11 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
@Override
public ShopUser getShopUserInfo(Long shopId, long userId) {
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
ShopUser shopUser = queryChain().eq(ShopUser::getMainShopId, shopId).eq(ShopUser::getUserId, userId).one();
ShopUser shopUser = queryChain().eq(ShopUser::getUserId, userId).and(q -> {
q.eq(ShopUser::getMainShopId, mainShopId).or(q1 -> {
q1.eq(ShopUser::getSourceShopId, shopId);
});
}).one();
if (shopUser == null) {
shopUser = new ShopUser();
UserInfo userInfo = userInfoService.getById(userId);