From d42be4d7c953f33d926af5c92038e45c200c946f Mon Sep 17 00:00:00 2001 From: wintel Date: Sun, 30 Mar 2025 17:12:18 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=8A=A8=E6=80=81API=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.App/DynamicApiApp/DynamicApiApp.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenAuth.App/DynamicApiApp/DynamicApiApp.cs b/OpenAuth.App/DynamicApiApp/DynamicApiApp.cs index 30d60c79..197f348f 100644 --- a/OpenAuth.App/DynamicApiApp/DynamicApiApp.cs +++ b/OpenAuth.App/DynamicApiApp/DynamicApiApp.cs @@ -227,8 +227,8 @@ namespace OpenAuth.App return result; } - // 设置更新时间 - if (!dict.ContainsKey("UpdateTime")) + // 如果有UpdateTime字段,自动设置 + if (dict.ContainsKey("UpdateTime")) { dict["UpdateTime"] = DateTime.Now; } @@ -245,7 +245,7 @@ namespace OpenAuth.App // 更新数据 await _client.Updateable(dict) .AS(req.TableName) - .Where("Id = @id", new { id = dict["Id"] }) + .WhereColumns("Id") // 使用Id作为更新条件 .ExecuteCommandAsync(); result.Message = "更新成功";