diff --git a/app/db/db_user_identity.go b/app/db/db_user_identity.go index 94aa1fa..37e55a4 100644 --- a/app/db/db_user_identity.go +++ b/app/db/db_user_identity.go @@ -32,7 +32,7 @@ func (userIdentityDb *UserIdentityDb) GetUserIdentity(id int) (m *model.UserIden func (userIdentityDb *UserIdentityDb) UserIdentityExist(enterpriseId int, idNo string, certType int) (m *model.UserIdentity, err error) { m = new(model.UserIdentity) - has, err := userIdentityDb.Db.Where("enterprise_id =?", enterpriseId).And("id_no =?", idNo).And("cert_type =?", certType).Get(m) + has, err := userIdentityDb.Db.Where("enterprise_id =?", enterpriseId).And("state =?", enum.UserIdentityStateForNormal).And("id_no =?", idNo).And("cert_type =?", certType).Get(m) if err != nil { return nil, logx.Error(err) } @@ -44,7 +44,7 @@ func (userIdentityDb *UserIdentityDb) UserIdentityExist(enterpriseId int, idNo s func (userIdentityDb *UserIdentityDb) UserIdentityExistV1(enterpriseId int, name string) (m *model.UserIdentity, err error) { m = new(model.UserIdentity) - has, err := userIdentityDb.Db.Where("enterprise_id =?", enterpriseId).And("uid =?", userIdentityDb.Uid).And("name =?", name).Get(m) + has, err := userIdentityDb.Db.Where("enterprise_id =?", enterpriseId).And("state =?", enum.UserIdentityStateForNormal).And("uid =?", userIdentityDb.Uid).And("name =?", name).Get(m) if err != nil { return nil, logx.Error(err) }