diff --git a/pricing/pricing.py b/pricing/pricing.py index d6d936a..f964370 100644 --- a/pricing/pricing.py +++ b/pricing/pricing.py @@ -920,19 +920,19 @@ async def get_pricing_display(ppid, model=None): items.append(item) # 按模型过滤:只返回匹配该模型的定价项 + # 如果过滤后为空(单模型ppid没有model字段),退回不过滤 if model: filtered_items = [] for item in items: item_model = None - # 从 filters dict 中取 model if item.get('filters') and isinstance(item['filters'], dict): item_model = item['filters'].get('model') - # 从 filter_labels 中取(用 key 名"模型"查找) if not item_model and item.get('filter_labels'): item_model = item['filter_labels'].get('模型') if item_model == model: filtered_items.append(item) - items = filtered_items + if filtered_items: + items = filtered_items # 生成可读价格表 display_lines = [f"【{getattr(r, 'name', '')}】定价:"]