作者 唐旭辉

细化查询条件

@@ -132,7 +132,9 @@ func (PartnerInfoService *PartnerInfoService) GetPartnerInfo(q query.GetPartnerI @@ -132,7 +132,9 @@ func (PartnerInfoService *PartnerInfoService) GetPartnerInfo(q query.GetPartnerI
132 }); err != nil { 132 }); err != nil {
133 return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error()) 133 return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
134 } 134 }
135 - partnerData, err = PartnerInfoRepository.FindOne(domain.PartnerFindOneQuery{UserId: q.Id}) 135 + partnerData, err = PartnerInfoRepository.FindOne(domain.PartnerFindOneQuery{
  136 + UserId: q.Id, CompanyId: q.CompanyId,
  137 + })
136 if err != nil { 138 if err != nil {
137 return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error()) 139 return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
138 } 140 }
@@ -198,7 +200,7 @@ func (PartnerInfoService *PartnerInfoService) UpdatePartnerInfo(cmd *command.Upd @@ -198,7 +200,7 @@ func (PartnerInfoService *PartnerInfoService) UpdatePartnerInfo(cmd *command.Upd
198 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e) 200 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
199 } 201 }
200 partnerInfo, err := partnerInfoRepository.FindOne(domain.PartnerFindOneQuery{ 202 partnerInfo, err := partnerInfoRepository.FindOne(domain.PartnerFindOneQuery{
201 - UserId: cmd.Id, 203 + UserId: cmd.Id, CompanyId: cmd.CompanyId,
202 }) 204 })
203 if err != nil { 205 if err != nil {
204 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error()) 206 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())