修复:删除最后店铺绑定时软删除用户
This commit is contained in:
+9
-1
@@ -1076,12 +1076,20 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean deleteUserInShop(Long id, Long shopId) {
|
||||
Long normalizedShopId = normalizeShopId(shopId);
|
||||
if (normalizedShopId == null) {
|
||||
throw new RuntimeException("当前操作缺少店铺上下文");
|
||||
}
|
||||
return userShopBindingSupport.deleteBinding(id, normalizedShopId);
|
||||
boolean deleted = userShopBindingSupport.deleteBinding(id, normalizedShopId);
|
||||
if (!deleted) {
|
||||
return false;
|
||||
}
|
||||
if (userShopBindingSupport.listBindingsByUserId(id, false).isEmpty()) {
|
||||
return deleteUser(id);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user