product_management/models/product_category.json
yumoqing 4fd136bf53 refactor: reseller org_id isolation for product_management module
- product_category: org_id scoped tree, product_table_name -> product_type
- product: org_id scoped, added extra_json for custom attributes, product_type field
- product_type_config: org_id + operator_id dual isolation, unique key on (org_id, operator_id, category_id, config_name)
- All 18 API endpoints enforce org_id filtering via ServerEnv
- core.py: all methods accept optional org_id, default to current user's org
- CRUD definitions: logined_userorgid set to org_id on all lists
- init/data.json: removed hardcoded global categories (managed per reseller)
- Rebuilt mysql.ddl.sql and all CRUD UI files
2026-05-25 17:03:08 +08:00

159 lines
3.7 KiB
JSON

{
"summary": [
{
"name": "product_category",
"title": "产品类别树",
"primary": [
"id"
],
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "主键ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "parent_id",
"title": "父类别ID",
"type": "str",
"length": 32,
"default": "0"
},
{
"name": "name",
"title": "类别名称",
"type": "str",
"length": 255,
"nullable": "no"
},
{
"name": "description",
"title": "类别描述",
"type": "text"
},
{
"name": "has_product",
"title": "是否可挂产品",
"type": "char",
"length": 1,
"default": "0"
},
{
"name": "product_type",
"title": "产品类型标识",
"type": "str",
"length": 64
},
{
"name": "product_type_title",
"title": "产品类型显示名",
"type": "str",
"length": 255
},
{
"name": "sort_order",
"title": "排序序号",
"type": "int",
"default": "0"
},
{
"name": "icon",
"title": "图标",
"type": "str",
"length": 255
},
{
"name": "status",
"title": "状态",
"type": "char",
"length": 1,
"default": "1"
},
{
"name": "org_id",
"title": "所属机构ID",
"type": "str",
"length": 32,
"default": "0"
},
{
"name": "created_by",
"title": "创建人",
"type": "str",
"length": 32
},
{
"name": "created_at",
"title": "创建时间",
"type": "datetime",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "datetime",
"nullable": "no"
}
],
"indexes": [
{
"name": "idx_pc_org_parent",
"idxtype": "index",
"idxfields": [
"org_id",
"parent_id"
]
},
{
"name": "idx_pc_org_status",
"idxtype": "index",
"idxfields": [
"org_id",
"status"
]
},
{
"name": "idx_pc_org_type",
"idxtype": "index",
"idxfields": [
"org_id",
"product_type"
]
}
],
"codes": [
{
"field": "parent_id",
"table": "product_category",
"valuefield": "id",
"textfield": "name",
"cond": "has_product='0'"
},
{
"field": "has_product",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "id='has_product_flg'"
},
{
"field": "status",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "id='product_category_status'"
},
{
"field": "product_type",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "id='product_type'"
}
]
}