fix: non-field keys in pricing items skip instead of raise - aligns top-level loop (line 618) with filters loop (line 653) behavior - value_mode and other control params at filter level no longer cause 'fields中没有定义' error
This commit is contained in:
parent
3a9e30313b
commit
6df2569c8e
@ -609,7 +609,7 @@ order by b.enabled_date desc"""
|
|||||||
ns = DictObject(**config_data)
|
ns = DictObject(**config_data)
|
||||||
|
|
||||||
# 检查过滤条件(排除定价计算字段)
|
# 检查过滤条件(排除定价计算字段)
|
||||||
skip_keys = {'formula', 'price_factors', 'unit_prices', 'unit', 'min_amount', 'filters', 'pricing_type', 'value_mode'}
|
skip_keys = {'formula', 'price_factors', 'unit_prices', 'unit', 'min_amount', 'filters', 'pricing_type'}
|
||||||
for k, spec_value in p.items():
|
for k, spec_value in p.items():
|
||||||
if spec_value is None:
|
if spec_value is None:
|
||||||
continue
|
continue
|
||||||
@ -617,9 +617,7 @@ order by b.enabled_date desc"""
|
|||||||
continue
|
continue
|
||||||
f = d.fields.get(k)
|
f = d.fields.get(k)
|
||||||
if not f:
|
if not f:
|
||||||
e = f'定价项({i})中的{k}在fields中没有定义'
|
continue # 非字段key(如value_mode等控制参数),跳过
|
||||||
exception(f'{e}')
|
|
||||||
raise Exception(e)
|
|
||||||
data_value = config_data.get(k)
|
data_value = config_data.get(k)
|
||||||
data_value = data_mapping(d, k, data_value)
|
data_value = data_mapping(d, k, data_value)
|
||||||
if data_value is None:
|
if data_value is None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user