fix: 解决节点资产数量方法计算不准确的问题

pull/11669/head
Bai 2023-09-22 15:05:18 +08:00 committed by Bryan
parent 7128593502
commit cefd9f4ab2
1 changed files with 1 additions and 6 deletions

View File

@ -402,12 +402,7 @@ class NodeAssetsMixin(NodeAllAssetsMappingMixin):
return Asset.objects.filter(q).distinct()
def get_assets_amount(self):
q = Q(node__key__startswith=f'{self.key}:') | Q(node__key=self.key)
return self.assets.through.objects.filter(q).count()
def get_assets_account_by_children(self):
children = self.get_all_children().values_list()
return self.assets.through.objects.filter(node_id__in=children).count()
return self.get_all_assets().count()
@classmethod
def get_node_all_assets_by_key_v2(cls, key):