- 4张表: voucher_template, voucher_rule, voucher_instance, voucher_usage_log - 可配置规则引擎: registry + validators + engine - 8种内置规则: min_amount, max_amount, applicable_product_type, applicable_product, exclude_product, max_usage_count, valid_period, user_level - CRUD定义 + API接口 + 前端页面 - SQL建表脚本 + RBAC权限配置 - 一次性使用,不找零
12 lines
406 B
Plaintext
12 lines
406 B
Plaintext
import json
|
|
|
|
conditions = {'id': params_kw.get('id', '')}
|
|
data = {}
|
|
for key in ['instance_id', 'customer_id', 'order_id', 'face_value', 'deducted_amount', 'used_by', 'product_type', 'product_name']:
|
|
val = params_kw.get(key, None) if hasattr(params_kw, 'get') else None
|
|
if val is not None:
|
|
data[key] = val
|
|
|
|
result = await update_voucher_usage_log(conditions, data)
|
|
return json.dumps(result)
|