@@ -250,12 +250,15 @@ namespace IRaCIS.Core.Application.Service
|
||||
var userId = userInfo.SystemUserId;
|
||||
var userTypeId = userInfo.UserTypeId;
|
||||
|
||||
var findTrialUser = await _trialIdentityUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.IdentityUserId == userId);
|
||||
|
||||
|
||||
//判断TrialUser中是否存在 不存在就插入 注意退出了,也不能再加进来
|
||||
if (!await _trialIdentityUserRepository.AnyAsync(t => t.TrialId == trialId && t.IdentityUserId == userId, true))
|
||||
if (!await _trialUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.UserRole.IdentityUserId == userId && t.UserRole.UserTypeId==userTypeId, true))
|
||||
{
|
||||
|
||||
|
||||
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new UserRole() { Status = UserStateEnum.Enable });
|
||||
|
||||
Reference in New Issue
Block a user