discount_customer_bind: - UNIQUE(customerid) → UNIQUE(customerid, resellerid) 一个客户可绑定多个分销商 - bind_type: 加 3=域名注册 - 索引重命名: idx_dcb_customer → idx_dcb_customer_reseller reseller_discount_tier (新增): - 分销商阶梯折扣: name, min_amount, max_amount, discount_pct - 按累计消费自动匹配档位
98 lines
2.4 KiB
JSON
98 lines
2.4 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "discount_customer_bind",
|
|
"title": "客户归属关系",
|
|
"primary": ["id"],
|
|
"catelog": "relation"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "customerid",
|
|
"title": "客户用户id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "resellerid",
|
|
"title": "归属分销商机构id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "sale_id",
|
|
"title": "归属销售用户id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "promo_code_id",
|
|
"title": "促销码id(空=非促销码方式)",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "bind_type",
|
|
"title": "绑定方式(1=促销码 2=手动 3=域名注册)",
|
|
"type": "char",
|
|
"length": 1,
|
|
"default": "1",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"title": "绑定时间",
|
|
"type": "timestamp",
|
|
"nullable": "no"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx_dcb_customer_reseller",
|
|
"idxtype": "unique",
|
|
"idxfields": ["customerid", "resellerid"]
|
|
},
|
|
{
|
|
"name": "idx_dcb_reseller",
|
|
"idxtype": "index",
|
|
"idxfields": ["resellerid"]
|
|
},
|
|
{
|
|
"name": "idx_dcb_sale",
|
|
"idxtype": "index",
|
|
"idxfields": ["sale_id"]
|
|
},
|
|
{
|
|
"name": "idx_dcb_promo",
|
|
"idxtype": "index",
|
|
"idxfields": ["promo_code_id"]
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "resellerid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "bind_type",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='bind_type'"
|
|
}
|
|
]
|
|
}
|