1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| 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
| }
|
|