创建集群的时候可以填写DNS信息/集群设置页增加DNS设置功能

This commit is contained in:
刘祥超
2020-11-15 16:28:29 +08:00
parent fd7082cff6
commit 2eb81b52a0
4 changed files with 35 additions and 2 deletions

View File

@@ -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()
}