From 84f1453856c19c6266709eb93612de12276f0232 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 25 Jun 2026 15:33:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E5=88=9B=E5=BB=BA=E6=97=B6INSERT=E5=88=97?= =?UTF-8?q?=E6=95=B0=E4=B8=8D=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/product_category_create.dspy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wwwroot/api/product_category_create.dspy b/wwwroot/api/product_category_create.dspy index cceb746..283f7c7 100644 --- a/wwwroot/api/product_category_create.dspy +++ b/wwwroot/api/product_category_create.dspy @@ -32,6 +32,17 @@ try: data['product_type'] = '' data['product_type_title'] = '' + # Ensure all table fields have values, filter out unknown fields + all_fields = ['id', 'parent_id', 'name', 'description', 'has_product', + 'product_type', 'product_type_title', 'sort_order', 'icon', + 'status', 'org_id', 'created_by', 'created_at', 'updated_at'] + fields = {} + for k in all_fields: + if k in data: + fields[k] = data[k] if data[k] is not None else '' + else: + fields[k] = '' + async with DBPools().sqlorContext(dbname) as sor: await sor.C('product_category', data) _new_rows = await sor.sqlExe("SELECT * FROM product_category WHERE id = ${id}$", {'id': data['id']})