...
|
...
|
@@ -670,18 +670,23 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs |
|
|
var (
|
|
|
companys []dto.CompanyItem
|
|
|
orgs []dto.OrgItem
|
|
|
mapCompany = make(map[int]interface{})
|
|
|
)
|
|
|
|
|
|
for _, v := range result.Users {
|
|
|
for i := range result.Users {
|
|
|
user := result.Users[i]
|
|
|
if _, ok := mapCompany[user.Company.CompanyId]; !ok {
|
|
|
companys = append(companys, dto.CompanyItem{
|
|
|
CompanyId: v.Company.CompanyId,
|
|
|
CompanyName: v.Company.CompanyName,
|
|
|
CompanyId: user.Company.CompanyId,
|
|
|
CompanyName: user.Company.CompanyName,
|
|
|
})
|
|
|
for _, vv := range v.UserOrg {
|
|
|
}
|
|
|
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,
|
|
|
})
|
|
|
}
|
|
|
}
|
...
|
...
|
|