1
2
3
4
5
6
7
8
9
10
11
12
13
14
| package db
|
| // 查询小区表
| func GetCommunityIDs() ([]string, error) {
| // 查询数据
| var db = DB
| var communityIDs []string
| result := db.Table("domain_unit").Where("domain_type = ?", 1).Pluck("id", &communityIDs)
| if result.Error != nil {
| return nil, result.Error
| }
|
| return communityIDs, nil
| }
|
|