region: wires: totalCountQ: filter networks by scope and owner

This commit is contained in:
Yousong Zhou
2021-02-02 16:07:02 +08:00
parent aa60527b8d
commit b471c727a3
+1 -1
View File
@@ -594,7 +594,7 @@ func (manager *SWireManager) totalCountQ(
netifNicSQ := netifNicQ.GroupBy(netifNics.Field("network_id")).SubQuery()
dbNicSQ := dbNicQ.GroupBy(dbNics.Field("network_id")).SubQuery()
networks := NetworkManager.Query().SubQuery()
networks := filterByScopeOwnerId(NetworkManager.Query(), scope, ownerId).SubQuery()
netQ := networks.Query(
networks.Field("wire_id"),
sqlchemy.COUNT("id").Label("net_count"),