From e6029d5e788b1c949f164264d9c7ec562d91476f Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 25 Aug 2021 18:39:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E7=BE=A4=E6=94=AF=E6=8C=81=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=9F=9F=E5=90=8D=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/node_cluster_dao.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/db/models/node_cluster_dao.go b/internal/db/models/node_cluster_dao.go index 84c74fd5..a37fbce4 100644 --- a/internal/db/models/node_cluster_dao.go +++ b/internal/db/models/node_cluster_dao.go @@ -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).