From 1086d69419f469409050c3f83da76509ef2dfb15 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Tue, 26 May 2026 17:33:37 +0800 Subject: [PATCH] update --- b/cntoai/model_management_add.dspy | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/b/cntoai/model_management_add.dspy b/b/cntoai/model_management_add.dspy index 09a74f4..6ff492d 100644 --- a/b/cntoai/model_management_add.dspy +++ b/b/cntoai/model_management_add.dspy @@ -61,6 +61,15 @@ async def model_management_add(ns={}): await sor.rollback() return {'status': False, 'msg': 'create model failed, missing model id'} + # 未传 sort_order 时,默认与新建主键 id 相同 + if not ( + 'sort_order' in ns + and ns.get('sort_order') is not None + and ns.get('sort_order') != '' + ): + await sor.U('model_management', {'id': model_id, 'sort_order': model_id}) + model_dic['sort_order'] = model_id + result_data = dict(model_dic) result_data['id'] = model_id