소스 검색

!1027 修复单独日志库没有差异日志问题
Merge pull request !1027 from 老李头/next

zuohuaijun 2 년 전
부모
커밋
ea223d9d4e
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

+ 3 - 1
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

@@ -275,7 +275,9 @@ public static class SqlSugarSetup
                 Parameters = JSON.Serialize(u.Parameters),
                 Elapsed = u.Time == null ? 0 : (long)u.Time.Value.TotalMilliseconds
             };
-            await db.CopyNew().Insertable(logDiff).ExecuteCommandAsync();
+            //修复单独日志库没有差异日志问题
+            var _db = SqlSugarSetup.ITenant.IsAnyConnection(SqlSugarConst.LogConfigId) ? ITenant.GetConnectionScope(SqlSugarConst.LogConfigId) : db;
+            await _db.CopyNew().Insertable(logDiff).ExecuteCommandAsync();
             Console.ForegroundColor = ConsoleColor.Red;
             Console.WriteLine(DateTime.Now + $"\r\n*****开始差异日志*****\r\n{Environment.NewLine}{JSON.Serialize(logDiff)}{Environment.NewLine}*****结束差异日志*****\r\n");
         };