mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-08 02:20:24 +08:00
创建集群的时候可以填写DNS信息/集群设置页增加DNS设置功能
This commit is contained in:
@@ -195,3 +195,19 @@ func (this *DNSDomainDAO) FindDomainRouteName(domainId int64, routeCode string)
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// 判断是否有域名可选
|
||||
func (this *DNSDomainDAO) ExistAvailableDomains() (bool, error) {
|
||||
subQuery, err := SharedDNSProviderDAO.Query().
|
||||
Where("state=1"). // 这里要使用非变量
|
||||
ResultPk().
|
||||
AsSQL()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return this.Query().
|
||||
State(DNSDomainStateEnabled).
|
||||
Attr("isOn", true).
|
||||
Where("providerId IN (" + subQuery + ")").
|
||||
Exist()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user