diff --git a/internal/const/const.go b/internal/const/const.go index 670114c8..46de635f 100644 --- a/internal/const/const.go +++ b/internal/const/const.go @@ -22,5 +22,5 @@ const ( UserNodeVersion = "0.0.9" AuthorityNodeVersion = "0.0.2" MonitorNodeVersion = "0.0.2" - DNSNodeVersion = "0.0.1" + DNSNodeVersion = "0.0.2" ) diff --git a/internal/db/models/nameservers/ns_node_dao.go b/internal/db/models/nameservers/ns_node_dao.go index 8e9814bb..269da324 100644 --- a/internal/db/models/nameservers/ns_node_dao.go +++ b/internal/db/models/nameservers/ns_node_dao.go @@ -335,6 +335,7 @@ func (this NSNodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, statusJSON []by func (this *NSNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error) { return this.Query(tx). State(NSNodeStateEnabled). + Where("clusterId IN (SELECT id FROM "+SharedNSClusterDAO.Table+" WHERE state=1)"). Where("status IS NOT NULL"). Where("(JSON_EXTRACT(status, '$.buildVersionCode') IS NULL OR JSON_EXTRACT(status, '$.buildVersionCode')<:version)"). Param("version", utils.VersionToLong(version)).