zhangzengfei
2024-09-28 b1d7efd8c4ab9c4bf56f62e636a358a5182c09bf
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
}