作者 yangfu

修改: 1.合伙人登录校验公司模块权限

... ... @@ -422,7 +422,7 @@ func LoginV2(header *protocol.RequestHeader, request *protocol.LoginRequestV2) (
}
break
case int(protocolx.AdminTypeManager):
if p, e := UsersRepository.FindOne(map[string]interface{}{"phone": claim.Phone, "companyId": request.Cid}); e == nil {
if p, e := UsersRepository.FindOne(map[string]interface{}{"phone": claim.Phone, "companyId": request.Cid, "deleteAtIsNull": true}); e == nil {
userId = p.Id
if !p.IsEnable() {
err = protocol.NewErrWithMessage(10006, err) //当前账号已被禁用
... ...
... ... @@ -53,6 +53,7 @@ func (repository *UsersRepository) FindOne(queryOptions map[string]interface{})
query.SetWhere("status = ?", "status")
query.SetWhere("phone = ?", "phone")
query.SetWhere("company_id = ?", "companyId")
query.SetWhere(`delete_at is null`, "deleteAtIsNull")
if err := query.First(); err != nil {
return nil, fmt.Errorf("query row not found")
}
... ...