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

This commit is contained in:
GoEdgeLab
2021-02-06 19:40:53 +08:00
parent 8d13ee1ce9
commit 1469f4b2f7

View File

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