根据区域查询节点数量时加入集群状态条件

This commit is contained in:
刘祥超
2021-02-06 19:40:53 +08:00
parent cd6a264730
commit 39e41acf1e

View File

@@ -738,6 +738,7 @@ func (this *NodeDAO) CountAllEnabledNodesWithRegionId(tx *dbs.Tx, regionId int64
return this.Query(tx). return this.Query(tx).
State(NodeStateEnabled). State(NodeStateEnabled).
Attr("regionId", regionId). Attr("regionId", regionId).
Where("clusterId IN (SELECT id FROM " + SharedNodeClusterDAO.Table + " WHERE state=1)").
Count() Count()
} }