From da0cf9cc28662b34e09ee2a0609e8ed39f3916dc Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 25 Apr 2022 10:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E8=AE=A1=E9=81=97=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs b/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs index 3d1a09b8c..50e1bb992 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs @@ -50,7 +50,12 @@ namespace IRaCIS.Core.Application.Triggers { context.Entity.CreateUserId = _userInfo.Id; context.Entity.CreateUser = _userInfo.UserName; + } + + if (context.Entity.CreateTime == default(DateTime)) + { context.Entity.CreateTime = DateTime.UtcNow.AddHours(8); + } return Task.CompletedTask;