From bfd691f9ac18a1a9a1581a1ef5c6e6c148033b22 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 20 Jul 2026 20:13:52 +0800 Subject: [PATCH] =?UTF-8?q?sub=5Fdistributors=E6=B7=BB=E5=8A=A0sub=5Fdistr?= =?UTF-8?q?ibutorid(org=5Fid)=E5=AD=97=E6=AE=B5+=E5=94=AF=E4=B8=80?= =?UTF-8?q?=E7=B4=A2=E5=BC=95,=E5=AF=B9=E9=BD=90sub=5Fresellers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/mysql.ddl.sql | 2 ++ models/sub_distributors.json | 42 +++++++++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/models/mysql.ddl.sql b/models/mysql.ddl.sql index d1af7bc..6da3eec 100644 --- a/models/mysql.ddl.sql +++ b/models/mysql.ddl.sql @@ -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 diff --git a/models/sub_distributors.json b/models/sub_distributors.json index 21f9b43..fdac8c2 100644 --- a/models/sub_distributors.json +++ b/models/sub_distributors.json @@ -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",