wuchen 2 месяцев назад
Родитель
Сommit
c54d9621a0

+ 1 - 1
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/StorePlatformUserRoleServiceImpl.java

@@ -831,6 +831,7 @@ public class StorePlatformUserRoleServiceImpl extends ServiceImpl<StorePlatformU
             updateWrapper.eq(StorePlatformUserRole::getId, id)
                     .eq(StorePlatformUserRole::getDeleteFlag, 0) // 只更新未删除的记录
                     .set(StorePlatformUserRole::getStatus, status);
+            int updateResult = storePlatformUserRoleMapper.update(null, updateWrapper);
             // 根据传入的 status 值更新
             StoreUser storeUser = storeUserMapper.selectById(userRole.getUserId());
             if (storeUser != null && storeUser.getPhone() != null) {
@@ -847,7 +848,6 @@ public class StorePlatformUserRoleServiceImpl extends ServiceImpl<StorePlatformU
                 }
             }
 
-            int updateResult = storePlatformUserRoleMapper.update(null, updateWrapper);
             if (updateResult > 0) {
                 String statusText = status == 0 ? "启用" : "禁用";
                 log.info("成功{}子账号: id={}, userId={}, storeId={}, roleId={}, status={}",