集群支持使用域名搜索

This commit is contained in:
GoEdgeLab
2021-08-25 18:39:17 +08:00
parent 7958b719d0
commit e6029d5e78

View File

@@ -193,7 +193,7 @@ func (this *NodeClusterDAO) CountAllEnabledClusters(tx *dbs.Tx, keyword string)
query := this.Query(tx).
State(NodeClusterStateEnabled)
if len(keyword) > 0 {
query.Where("(name LIKE :keyword OR dnsName like :keyword)").
query.Where("(name LIKE :keyword OR dnsName like :keyword OR (dnsDomainId > 0 AND dnsDomainId IN (SELECT id FROM "+dns.SharedDNSDomainDAO.Table+" WHERE name LIKE :keyword AND state=1)))").
Param("keyword", "%"+keyword+"%")
}
return query.Count()
@@ -204,7 +204,7 @@ func (this *NodeClusterDAO) ListEnabledClusters(tx *dbs.Tx, keyword string, offs
query := this.Query(tx).
State(NodeClusterStateEnabled)
if len(keyword) > 0 {
query.Where("(name LIKE :keyword OR dnsName like :keyword)").
query.Where("(name LIKE :keyword OR dnsName like :keyword OR (dnsDomainId > 0 AND dnsDomainId IN (SELECT id FROM "+dns.SharedDNSDomainDAO.Table+" WHERE name LIKE :keyword AND state=1)))").
Param("keyword", "%"+keyword+"%")
}
_, err = query.
@@ -469,8 +469,6 @@ func (this *NodeClusterDAO) UpdateClusterDNS(tx *dbs.Tx, clusterId int64, dnsNam
return this.NotifyDNSUpdate(tx, clusterId)
}
// FindClusterAdminId 查找集群所属管理员
func (this *NodeClusterDAO) FindClusterAdminId(tx *dbs.Tx, clusterId int64) (int64, error) {
return this.Query(tx).