加入会员接口修改

This commit is contained in:
张松
2025-03-11 18:00:56 +08:00
parent c45a8535e2
commit e8ee3bb24b

View File

@@ -256,6 +256,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
shopUser = new ShopUser(); shopUser = new ShopUser();
shopUser.setShopId(shopId); shopUser.setShopId(shopId);
shopUser.setUserId(userId); shopUser.setUserId(userId);
save(shopUser);
} else if (shopUser.getIsVip() == 1) { } else if (shopUser.getIsVip() == 1) {
throw new ApiNotPrintException("您已加入店铺会员"); throw new ApiNotPrintException("您已加入店铺会员");
} }
@@ -263,8 +264,10 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
shopUser.setIsVip(1); shopUser.setIsVip(1);
shopUser.setCode(generateCode(shopId)); shopUser.setCode(generateCode(shopId));
shopUser.setJoinTime(DateUtil.date().toLocalDateTime()); shopUser.setJoinTime(DateUtil.date().toLocalDateTime());
shopUser.setUserId(null);
shopUser.setShopId(null);
return saveOrUpdate(shopUser); return updateById(shopUser);
} }
@Override @Override