fix: 订单列表兼容 leixing_id 与 ProductTypeID 商品类型筛选

This commit is contained in:
XingQue
2026-06-20 01:17:59 +08:00
parent 4ded4ea50a
commit 3fecb9390f
3 changed files with 24 additions and 23 deletions

View File

@@ -501,6 +501,19 @@ def pick_order_id(data):
return str(data.get('OrderID') or data.get('dingdan_id') or '').strip()
def pick_leixing_id(data):
"""兼容前端 leixing_id 与 SDK 字段 ProductTypeID。"""
val = data.get('leixing_id')
if val is None or val == '':
val = data.get('ProductTypeID')
if val is None or val == '':
return None
try:
return int(val)
except (ValueError, TypeError):
return None
def pick_penalty_create_params(data):
"""兼容罚单创建SDK 字段名与旧版拼音字段名。"""
penalized_id = str(data.get('PenalizedUserID') or data.get('beichufa_id') or '').strip()