sub_distributors添加sub_distributorid(org_id)字段+唯一索引,对齐sub_resellers

This commit is contained in:
yumoqing 2026-07-20 20:13:52 +08:00
parent 8bb688374c
commit bfd691f9ac
2 changed files with 34 additions and 10 deletions

View File

@ -304,6 +304,7 @@ CREATE TABLE sub_distributors
`id` VARCHAR(32) NOT NULL comment '主键ID',
`resellerid` VARCHAR(32) NOT NULL comment '所属主分销商机构ID',
`sub_distributorid` VARCHAR(32) NOT NULL comment '二级分销商机构ID',
`sub_dist_name` VARCHAR(255) NOT NULL comment '二级分销商名称',
`contact_person` VARCHAR(100) comment '联系人',
`contact_phone` VARCHAR(50) comment '联系电话',
@ -330,6 +331,7 @@ comment '二级分销商表'
;
CREATE INDEX sub_distributors_idx_sd_reseller ON sub_distributors(resellerid);
CREATE UNIQUE INDEX sub_distributors_idx_sd_sub_distributorid ON sub_distributors(resellerid,sub_distributorid);
CREATE INDEX sub_distributors_idx_sd_manager ON sub_distributors(managed_by);
-- ./platform_supply_relations.json

View File

@ -18,18 +18,26 @@
"nullable": "no"
},
{
"name": "resellerid",
"title": "所属主分销商机构ID",
"type": "str",
"length": 32,
"nullable": "no"
"name": "resellerid",
"title": "所属主分销商机构ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "sub_dist_name",
"title": "二级分销商名称",
"type": "str",
"length": 255,
"nullable": "no"
"name": "sub_distributorid",
"title": "二级分销商机构ID",
"type": "str",
"length": 32,
"nullable": "no",
"default": ""
},
{
"name": "sub_dist_name",
"title": "二级分销商名称",
"type": "str",
"length": 255,
"nullable": "no"
},
{
"name": "contact_person",
@ -121,6 +129,14 @@
"resellerid"
]
},
{
"name": "idx_sd_sub_distributorid",
"idxtype": "unique",
"idxfields": [
"resellerid",
"sub_distributorid"
]
},
{
"name": "idx_sd_manager",
"idxtype": "index",
@ -136,6 +152,12 @@
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "sub_distributorid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "status",
"table": "appcodes_kv",