筛选
This commit is contained in:
parent
fee32191cb
commit
ffdcf88860
@ -174,9 +174,10 @@ public class MyController : IDynamicApiController
|
||||
if (string.IsNullOrEmpty(input.IdCardImageUrl)) throw Oops.Bah("身份证正面图片不能为空");
|
||||
if (string.IsNullOrEmpty(input.IdCardBackImageUrl)) throw Oops.Bah("身份证背面图片不能为空");
|
||||
|
||||
// 身份证号查重
|
||||
// 身份证号查重(排除被单位删除的影子账号:无单位关联且无密码)
|
||||
var duplicateIdCard = await _appUserRepository.AsQueryable()
|
||||
.Where(u => u.IdCardNumber == input.IdCardNumber && u.Id != userId && !u.DeleteMark && u.PersonType == PersonType.Athlete)
|
||||
.Where(u => u.IdCardNumber == input.IdCardNumber && u.Id != userId && !u.DeleteMark && u.PersonType == PersonType.Athlete
|
||||
&& !(u.MerchantCertificationId == null && u.Password == null))
|
||||
.FirstAsync();
|
||||
if (duplicateIdCard != null) throw Oops.Bah("该身份证号已被其他用户使用");
|
||||
}
|
||||
@ -187,9 +188,10 @@ public class MyController : IDynamicApiController
|
||||
if (!input.Gender.HasValue) throw Oops.Bah("性别不能为空");
|
||||
if (!input.BirthDate.HasValue) throw Oops.Bah("出生日期不能为空");
|
||||
|
||||
// 护照号查重
|
||||
// 护照号查重(排除被单位删除的影子账号:无单位关联且无密码)
|
||||
var duplicatePassport = await _appUserRepository.AsQueryable()
|
||||
.Where(u => u.PassportNumber == input.PassportNumber && u.Id != userId && !u.DeleteMark && u.PersonType == PersonType.Athlete)
|
||||
.Where(u => u.PassportNumber == input.PassportNumber && u.Id != userId && !u.DeleteMark && u.PersonType == PersonType.Athlete
|
||||
&& !(u.MerchantCertificationId == null && u.Password == null))
|
||||
.FirstAsync();
|
||||
if (duplicatePassport != null) throw Oops.Bah("该护照号码已被其他用户使用");
|
||||
}
|
||||
@ -198,9 +200,10 @@ public class MyController : IDynamicApiController
|
||||
if (string.IsNullOrEmpty(input.HouseholdPhotoUrl)) throw Oops.Bah("户口本图片不能为空");
|
||||
if (string.IsNullOrEmpty(input.IdCardNumber)) throw Oops.Bah("身份证号不能为空");
|
||||
|
||||
// 身份证号查重
|
||||
// 身份证号查重(排除被单位删除的影子账号:无单位关联且无密码)
|
||||
var duplicateIdCard = await _appUserRepository.AsQueryable()
|
||||
.Where(u => u.IdCardNumber == input.IdCardNumber && u.Id != userId && !u.DeleteMark && u.PersonType == PersonType.Athlete)
|
||||
.Where(u => u.IdCardNumber == input.IdCardNumber && u.Id != userId && !u.DeleteMark && u.PersonType == PersonType.Athlete
|
||||
&& !(u.MerchantCertificationId == null && u.Password == null))
|
||||
.FirstAsync();
|
||||
if (duplicateIdCard != null) throw Oops.Bah("该身份证号已被其他用户使用");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user