- 新增3个数据模型: discount_marketing, discount_promo_code, discount_customer_bind - 新增CRUD定义: marketing/promo_code/customer_bind 的list和api - 新增init/data.json: appcodes编码(促销码类型、绑定方式) - init.py: bind_customer支持customerid参数覆盖(注册场景) - 折扣校验放宽至 0 < discount <= 1
107 lines
2.6 KiB
JSON
107 lines
2.6 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "discount_promo_code",
|
|
"title": "促销码",
|
|
"primary": ["id"],
|
|
"catelog": "entity"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "促销码(即id本身)",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "marketing_id",
|
|
"title": "营销方案id(可空=纯邀请码)",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "resellerid",
|
|
"title": "所属商户机构id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "sale_id",
|
|
"title": "生成销售id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "code_type",
|
|
"title": "码类型(1=促销码 2=邀请码)",
|
|
"type": "char",
|
|
"length": 1,
|
|
"default": "1",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"title": "状态",
|
|
"type": "char",
|
|
"length": 1,
|
|
"default": "1"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"title": "生成时间",
|
|
"type": "timestamp",
|
|
"default": "CURRENT_TIMESTAMP",
|
|
"nullable": "no"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx_dpc_reseller",
|
|
"idxtype": "index",
|
|
"idxfields": ["resellerid"]
|
|
},
|
|
{
|
|
"name": "idx_dpc_sale",
|
|
"idxtype": "index",
|
|
"idxfields": ["sale_id"]
|
|
},
|
|
{
|
|
"name": "idx_dpc_marketing",
|
|
"idxtype": "index",
|
|
"idxfields": ["marketing_id"]
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "resellerid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "marketing_id",
|
|
"table": "discount_marketing",
|
|
"valuefield": "id",
|
|
"textfield": "name"
|
|
},
|
|
{
|
|
"field": "code_type",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='promo_code_type'"
|
|
},
|
|
{
|
|
"field": "status",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='product_status'"
|
|
}
|
|
]
|
|
}
|