...
|
...
|
@@ -668,20 +668,25 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs |
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
var (
|
|
|
companys []dto.CompanyItem
|
|
|
orgs []dto.OrgItem
|
|
|
companys []dto.CompanyItem
|
|
|
orgs []dto.OrgItem
|
|
|
mapCompany = make(map[int]interface{})
|
|
|
)
|
|
|
|
|
|
for _, v := range result.Users {
|
|
|
companys = append(companys, dto.CompanyItem{
|
|
|
CompanyId: v.Company.CompanyId,
|
|
|
CompanyName: v.Company.CompanyName,
|
|
|
})
|
|
|
for _, vv := range v.UserOrg {
|
|
|
for i := range result.Users {
|
|
|
user := result.Users[i]
|
|
|
if _, ok := mapCompany[user.Company.CompanyId]; !ok {
|
|
|
companys = append(companys, dto.CompanyItem{
|
|
|
CompanyId: user.Company.CompanyId,
|
|
|
CompanyName: user.Company.CompanyName,
|
|
|
})
|
|
|
}
|
|
|
for j := range user.UserOrg {
|
|
|
org := user.UserOrg[j]
|
|
|
orgs = append(orgs, dto.OrgItem{
|
|
|
OrganizationId: vv.OrgID,
|
|
|
OrganizationName: vv.OrgName,
|
|
|
CompanyId: v.Company.CompanyId,
|
|
|
OrganizationId: org.OrgID,
|
|
|
OrganizationName: org.OrgName,
|
|
|
CompanyId: user.Company.CompanyId,
|
|
|
})
|
|
|
}
|
|
|
}
|
...
|
...
|
|