yumoqing 275806c1cc fix(product): 账号/存储产品展示缺失——建树KeyError+幽灵列+IN占位符三处修复
根因链(2026-09-06):
1. core.get_category_tree 单遍建树隐含「父节点排序在子前」假设:
   子类别 sort_order=0 < 顶级 10/20,ORDER BY 后子先处理,
   parent['children'].append 时父未初始化 → KeyError → storefront 500
2. storefront get_products.dspy SELECT p.icon——product 表无 icon 列 → 1054
3. 同文件 IN 占位符 f'${key}$' 生成 $cid_0$(缺花括号)sqlor 不识别

配套:init/data.json resource_module 字典补 account_resource/storage_resource
(类别编辑下拉可选),product_type 字典对应项由测试库同步补充。

数据:测试库已建账号资源/存储资源顶级类别并执行导入
(账号3产品:试用7天/月租/年租;存储1产品:工作空间标准存储)。
2026-09-06 14:03:44 +08:00

135 lines
6.4 KiB
JSON

{
"appcodes": [
{
"id": "product_status",
"name": "产品状态",
"hierarchy_flg": "0"
},
{
"id": "product_price_type",
"name": "产品价格类型",
"hierarchy_flg": "0"
},
{
"id": "product_category_status",
"name": "产品类别状态",
"hierarchy_flg": "0"
},
{
"id": "has_product_flg",
"name": "是否可挂产品",
"hierarchy_flg": "0"
},
{
"id": "product_type",
"name": "产品类型标识",
"hierarchy_flg": "0"
},
{
"id": "enabled_flg",
"name": "是否启用",
"hierarchy_flg": "0"
},
{
"id": "resource_type",
"name": "资源类型",
"hierarchy_flg": "0"
},
{
"id": "quota_unit",
"name": "配额单位",
"hierarchy_flg": "0"
},
{
"id": "price_unit",
"name": "价格单位",
"hierarchy_flg": "0"
},
{
"id": "subscription_type",
"name": "订购类型",
"hierarchy_flg": "0"
},
{
"id": "subscription_status",
"name": "订购状态",
"hierarchy_flg": "0"
},
{
"id": "overflow_mode",
"name": "超额模式",
"hierarchy_flg": "0"
},
{
"id": "billing_mode",
"name": "计费模式",
"hierarchy_flg": "0"
},
{
"id": "resource_module",
"name": "资源模块",
"hierarchy_flg": "0"
}
],
"appcodes_kv": [
{"id": "product_status_1", "parentid": "product_status", "k": "1", "v": "启用"},
{"id": "product_status_0", "parentid": "product_status", "k": "0", "v": "禁用"},
{"id": "product_price_type_1", "parentid": "product_price_type", "k": "1", "v": "固定价格"},
{"id": "product_price_type_2", "parentid": "product_price_type", "k": "2", "v": "阶梯价格"},
{"id": "product_price_type_3", "parentid": "product_price_type", "k": "3", "v": "议价"},
{"id": "product_category_status_1", "parentid": "product_category_status", "k": "1", "v": "启用"},
{"id": "product_category_status_0", "parentid": "product_category_status", "k": "0", "v": "禁用"},
{"id": "has_product_flg_1", "parentid": "has_product_flg", "k": "1", "v": "是"},
{"id": "has_product_flg_0", "parentid": "has_product_flg", "k": "0", "v": "否"},
{"id": "product_type_telecom", "parentid": "product_type", "k": "telecom", "v": "通信服务"},
{"id": "product_type_cloud", "parentid": "product_type", "k": "cloud", "v": "云服务"},
{"id": "product_type_data", "parentid": "product_type", "k": "data", "v": "数据服务"},
{"id": "product_type_api", "parentid": "product_type", "k": "api", "v": "API服务"},
{"id": "product_type_custom", "parentid": "product_type", "k": "custom", "v": "自定义"},
{"id": "product_type_llm_model", "parentid": "product_type", "k": "llm_model", "v": "大模型按量"},
{"id": "product_type_llm_monthly", "parentid": "product_type", "k": "llm_monthly", "v": "大模型包月"},
{"id": "product_type_compute", "parentid": "product_type", "k": "compute", "v": "算力"},
{"id": "enabled_flg_1", "parentid": "enabled_flg", "k": "1", "v": "启用"},
{"id": "enabled_flg_0", "parentid": "enabled_flg", "k": "0", "v": "禁用"},
{"id": "resource_type_llm_model", "parentid": "resource_type", "k": "llm_model", "v": "大模型按量"},
{"id": "resource_type_llm_monthly", "parentid": "resource_type", "k": "llm_monthly", "v": "大模型包月"},
{"id": "resource_type_compute", "parentid": "resource_type", "k": "compute", "v": "算力"},
{"id": "quota_unit_tokens", "parentid": "quota_unit", "k": "tokens", "v": "tokens"},
{"id": "quota_unit_requests", "parentid": "quota_unit", "k": "requests", "v": "次"},
{"id": "quota_unit_gpu_hours", "parentid": "quota_unit", "k": "gpu_hours", "v": "GPU时"},
{"id": "price_unit_per_1k_tokens", "parentid": "price_unit", "k": "per_1k_tokens", "v": "每千tokens"},
{"id": "price_unit_per_request", "parentid": "price_unit", "k": "per_request", "v": "每次"},
{"id": "price_unit_per_gpu_hour", "parentid": "price_unit", "k": "per_gpu_hour", "v": "每GPU时"},
{"id": "subscription_type_1", "parentid": "subscription_type", "k": "1", "v": "包月"},
{"id": "subscription_type_2", "parentid": "subscription_type", "k": "2", "v": "包量"},
{"id": "subscription_type_3", "parentid": "subscription_type", "k": "3", "v": "一次性"},
{"id": "subscription_status_1", "parentid": "subscription_status", "k": "1", "v": "活跃"},
{"id": "subscription_status_2", "parentid": "subscription_status", "k": "2", "v": "已过期"},
{"id": "subscription_status_3", "parentid": "subscription_status", "k": "3", "v": "已取消"},
{"id": "subscription_status_4", "parentid": "subscription_status", "k": "4", "v": "已超额"},
{"id": "overflow_mode_1", "parentid": "overflow_mode", "k": "1", "v": "转按量"},
{"id": "overflow_mode_2", "parentid": "overflow_mode", "k": "2", "v": "停服"},
{"id": "billing_mode_1", "parentid": "billing_mode", "k": "1", "v": "配额内"},
{"id": "billing_mode_2", "parentid": "billing_mode", "k": "2", "v": "超额按量"},
{"id": "resource_module_llmage", "parentid": "resource_module", "k": "llmage", "v": "大模型管理"},
{"id": "resource_module_supplychain", "parentid": "resource_module", "k": "supplychain", "v": "供应链管理"},
{"id": "resource_module_pipeline_llm", "parentid": "resource_module", "k": "pipeline_llm", "v": "产线模型治理"},
{"id": "resource_module_account_resource", "parentid": "resource_module", "k": "account_resource", "v": "账号资源"},
{"id": "resource_module_storage_resource", "parentid": "resource_module", "k": "storage_resource", "v": "存储资源"}
],
"_note_product_category": "产品类别树由每个 reseller (org_id) 自行管理,不在 init/data.json 中预设全局数据。新机构注册时自动创建根类别。"
}