优化字段

This commit is contained in:
jlj 2025-06-11 14:46:40 +08:00
parent af85cc7b56
commit 9bf919032f

View File

@ -3129,6 +3129,9 @@ def filter_public_creators(request):
else:
pricing_range = None
# 格式化items_sold
items_sold_formatted = f"{int(creator.items_sold)}" if creator.items_sold else "0"
# 格式化结果
formatted_creator = {
"public_id": public_creator.id,
@ -3145,6 +3148,7 @@ def filter_public_creators(request):
"pricing": pricing_range,
"pricing_package": creator.pricing_package,
"collab_count": creator.collab_count,
"items_sold": items_sold_formatted,
"remark": public_creator.remark,
"category_public": public_creator.category
}
@ -3453,6 +3457,9 @@ def filter_private_pool_creators(request):
else:
pricing_range = None
# 格式化items_sold
items_sold_formatted = f"{int(creator.items_sold)}" if creator.items_sold else "0"
# 格式化结果
formatted_creator = {
"relation_id": relation.id,
@ -3470,6 +3477,7 @@ def filter_private_pool_creators(request):
"avg_video_views": avg_views_formatted,
"pricing": pricing_range, # 使用格式化后的价格区间
"collab_count": creator.collab_count,
"items_sold": items_sold_formatted,
"notes": relation.notes,
"status": relation.status,
"added_from_public": relation.added_from_public,