package models func GetDomainFilters(orgIds, areaIds []interface{}) (filters []map[string]interface{}) { filters = make([]map[string]interface{}, 0) // 数据权限过滤 if len(orgIds) > 0 && len(areaIds) > 0 { var authParams = map[string]interface{}{ "bool": map[string]interface{}{ "should": []interface{}{ map[string]interface{}{ "terms": map[string]interface{}{ "orgId": orgIds, }}, map[string]interface{}{ "terms": map[string]interface{}{ "communityId": areaIds, }}, }, }, } filters = append(filters, authParams) } else if len(orgIds) > 0 { filters = append(filters, map[string]interface{}{ "terms": map[string]interface{}{ "orgId": orgIds, }, }) } else if len(areaIds) > 0 { filters = append(filters, map[string]interface{}{ "terms": map[string]interface{}{ "communityId": areaIds, }, }) } return filters }