discount/models/reseller_discount_tier.json
yumoqing 53eaa966ae feat: 客户归属支持多分销商 + 阶梯折扣表
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
- 按累计消费自动匹配档位
2026-06-30 15:45:15 +08:00

114 lines
2.7 KiB
JSON

{
"summary": [
{
"name": "reseller_discount_tier",
"title": "分销商阶梯折扣",
"primary": ["id"],
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "主键ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "resellerid",
"title": "分销商机构ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "name",
"title": "档位名称",
"type": "str",
"length": 50,
"nullable": "no"
},
{
"name": "min_amount",
"title": "最低消费金额",
"type": "float",
"length": 18,
"dec": 2,
"nullable": "no",
"default": "0.00"
},
{
"name": "max_amount",
"title": "最高消费金额(NULL=无上限)",
"type": "float",
"length": 18,
"dec": 2,
"nullable": "yes"
},
{
"name": "discount_pct",
"title": "折扣百分比",
"type": "float",
"length": 5,
"dec": 2,
"nullable": "no"
},
{
"name": "sort_order",
"title": "排序",
"type": "int",
"length": 4,
"nullable": "no",
"default": "0"
},
{
"name": "status",
"title": "状态",
"type": "str",
"length": 10,
"nullable": "no",
"default": "active"
},
{
"name": "created_at",
"title": "创建时间",
"type": "timestamp",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "timestamp",
"nullable": "no"
}
],
"indexes": [
{
"name": "idx_rdt_reseller_order",
"idxtype": "index",
"idxfields": ["resellerid", "sort_order"]
},
{
"name": "idx_rdt_amount",
"idxtype": "index",
"idxfields": ["resellerid", "min_amount"]
}
],
"codes": [
{
"field": "resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "status",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='discount_tier_status'"
}
]
}