浏览代码

邀请平台老师为机构老师、激活码调整

yuanliang 1 年之前
父节点
当前提交
eef2d89459

+ 2 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantActivationCodeServiceImpl.java

@@ -276,12 +276,8 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
         if (student == null) {
             throw new BizException("学生不存在");
         }
-        Long tenantId = -1L;
-        if (student.getTenantId() != null) {
-            tenantId = student.getTenantId();
-        }
         TenantActivationCode code = baseMapper.selectById(id);
-        if(code == null || !code.getTenantId().equals(tenantId)) {
+        if(code == null) {
             throw new BizException("激活码不存在");
         }
         SysUser sysUser = sysUserService.getDao().selectById(student.getUserId());
@@ -312,7 +308,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
 
         // 更新购买记录中激活码使用统计数量值
         Integer activeCodeNumber = this.lambdaQuery()
-                .eq(TenantActivationCode::getTenantId, tenantId)
+                .eq(TenantActivationCode::getTenantId, code.getTenantId())
                 .eq(TenantActivationCode::getTenantAlbumPurchaseId, code.getTenantAlbumPurchaseId())
                 .eq(TenantActivationCode::getActivationStatus, true).count();