From 748ad4907629c07b1d866fa699294dcf5a33709f Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Thu, 28 May 2026 18:20:40 +0800 Subject: [PATCH] update --- b/all_table.sql | 1 + b/cntoai/model_management_add.dspy | 2 +- b/cntoai/model_management_customer_search.dspy | 2 +- b/cntoai/model_management_search.dspy | 2 +- b/cntoai/model_management_update.dspy | 2 +- b/cntoai/model_usage_admin_report.dspy | 4 ++-- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/b/all_table.sql b/b/all_table.sql index f8aef26..a5f4c7c 100644 --- a/b/all_table.sql +++ b/b/all_table.sql @@ -1669,6 +1669,7 @@ CREATE TABLE `model_management` ( `provider` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '厂商名称', `model_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型标识名', `display_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '展示名称', + `model_logo` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型logo', `model_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型类型', `listing_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '上架状态:0待上架 1已上架', `sort_order` int(11) NOT NULL DEFAULT 0 COMMENT '排序权重,数值越小越靠前', diff --git a/b/cntoai/model_management_add.dspy b/b/cntoai/model_management_add.dspy index 6ff492d..e858e61 100644 --- a/b/cntoai/model_management_add.dspy +++ b/b/cntoai/model_management_add.dspy @@ -1,6 +1,6 @@ # model_management 可写入字段(不含 id、created_at、updated_at) _MODEL_FIELDS = ( - 'llmid', 'provider', 'model_name', 'display_name', 'model_type', + 'llmid', 'provider', 'model_name', 'display_name', 'model_logo', 'model_type', 'context_length', 'input_token_price', 'output_token_price', 'cache_hit_input_price', 'billing_method', 'billing_unit', 'capabilities', 'limitations', 'highlights', 'is_active', diff --git a/b/cntoai/model_management_customer_search.dspy b/b/cntoai/model_management_customer_search.dspy index 1876e1f..25c197c 100644 --- a/b/cntoai/model_management_customer_search.dspy +++ b/b/cntoai/model_management_customer_search.dspy @@ -5,7 +5,7 @@ def _escape(value): # 客户侧可见字段(不含 listing_status、is_active 等运营字段) _CUSTOMER_MODEL_COLUMNS = """ - id, llmid, provider, model_name, display_name, model_type, + id, llmid, provider, model_name, display_name, model_logo, model_type, context_length, input_token_price, output_token_price, cache_hit_input_price, billing_method, billing_unit, capabilities, limitations, highlights, description, sort_order,is_active, experience diff --git a/b/cntoai/model_management_search.dspy b/b/cntoai/model_management_search.dspy index 2547234..da350a9 100644 --- a/b/cntoai/model_management_search.dspy +++ b/b/cntoai/model_management_search.dspy @@ -1,6 +1,6 @@ # 可写入/更新的字段(不含 id、created_at、updated_at) _MODEL_FIELDS = ( - 'llmid', 'provider', 'model_name', 'display_name', 'model_type', + 'llmid', 'provider', 'model_name', 'display_name', 'model_logo', 'model_type', 'context_length', 'input_token_price', 'output_token_price', 'cache_hit_input_price', 'billing_method', 'billing_unit', 'capabilities', 'limitations', 'highlights', 'is_active', diff --git a/b/cntoai/model_management_update.dspy b/b/cntoai/model_management_update.dspy index c28d5b5..fcb6ae0 100644 --- a/b/cntoai/model_management_update.dspy +++ b/b/cntoai/model_management_update.dspy @@ -1,6 +1,6 @@ # model_management 可写入字段(不含 id、created_at、updated_at) _MODEL_FIELDS = ( - 'llmid', 'provider', 'model_name', 'display_name', 'model_type', + 'llmid', 'provider', 'model_name', 'display_name', 'model_logo', 'model_type', 'context_length', 'input_token_price', 'output_token_price', 'cache_hit_input_price', 'billing_method', 'billing_unit', 'capabilities', 'limitations', 'highlights', 'is_active', diff --git a/b/cntoai/model_usage_admin_report.dspy b/b/cntoai/model_usage_admin_report.dspy index e16f2b0..6b235db 100644 --- a/b/cntoai/model_usage_admin_report.dspy +++ b/b/cntoai/model_usage_admin_report.dspy @@ -491,8 +491,8 @@ async def model_usage_admin_report(ns={}): if group_by and group_by not in ('hour', 'day', 'week'): return {'status': False, 'msg': 'group_by 仅支持 hour / day / week'} - page_size = int(ns.get('page_size', 20)) - current_page = int(ns.get('current_page', 1)) + page_size = int(ns.get('page_size')) if ns.get('page_size') else 20 + current_page = int(ns.get('current_page')) if ns.get('current_page') else 1 offset = (current_page - 1) * page_size db = DBPools()