Просмотр исходного кода

!601 TenantId列更新时强制忽略更新
Merge pull request !601 from 清子/N/A

zuohuaijun 3 лет назад
Родитель
Сommit
6e06a4f29a
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

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

@@ -62,6 +62,9 @@ public static class SqlSugarSetup
                     if (type.PropertyType == typeof(bool) || type.PropertyType == typeof(bool?))
                         column.DataType = "number(1)";
                 }
+
+                if(column.PropertyName == "TenantId") ///租户Id列更新时强制忽略更新
+                    column.IsOnlyIgnoreUpdate = true;
             },
             DataInfoCacheService = new SqlSugarCache(),
         };