perf: 优化工单推荐资产的数量

pull/6512/head
ibuler 2021-07-20 18:48:03 +08:00 committed by 老广
parent 1116d1d353
commit 8f3fb60332
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ class ApplyApplicationSerializer(ApplySerializer, ApproveSerializer):
queries &= Q(type=apply_type)
with tmp_to_org(self.root.instance.org_id):
application_ids = Application.objects.filter(queries).values_list('id', flat=True)[:5]
application_ids = Application.objects.filter(queries).values_list('id', flat=True)[:15]
application_ids = [str(application_id) for application_id in application_ids]
return application_ids

View File

@ -144,7 +144,7 @@ class ApplyAssetSerializer(ApplySerializer, ApproveSerializer):
if not queries:
return []
with tmp_to_org(self.root.instance.org_id):
asset_ids = Asset.objects.filter(queries).values_list('id', flat=True)[:5]
asset_ids = Asset.objects.filter(queries).values_list('id', flat=True)[:100]
asset_ids = [str(asset_id) for asset_id in asset_ids]
return asset_ids