diff --git a/pricing/pricing.py b/pricing/pricing.py index 856cc08..b1826e4 100644 --- a/pricing/pricing.py +++ b/pricing/pricing.py @@ -644,7 +644,6 @@ order by b.enabled_date desc""" if 'unit_prices' in filter_item: continue # tiered定价项,不在此处检查 item_ok = True - item_value_mode = filter_item.get('value_mode') for fk, fv in filter_item.items(): if fk in ('unit_prices', 'value_mode'): continue @@ -656,7 +655,7 @@ order by b.enabled_date desc""" if data_value is None: continue # 数据中没有该键,视为匹配 try: - flg = check_value(f, fv, data_value, item_value_mode) + flg = check_value(f, fv, data_value) if not flg: item_ok = False break @@ -684,7 +683,6 @@ order by b.enabled_date desc""" # 处理 filters 中的区间定价(查找匹配的 unit_prices) if 'filters' in p: for filter_item in p['filters']: - item_value_mode = filter_item.get('value_mode') for fk, fv in filter_item.items(): if fk in ('unit_prices', 'value_mode'): continue @@ -696,7 +694,7 @@ order by b.enabled_date desc""" if data_value is None: continue try: - flg = check_value(f, fv, data_value, item_value_mode) + flg = check_value(f, fv, data_value) if flg and 'unit_prices' in filter_item: unit_price = filter_item['unit_prices'] except: