CreateBy全局处理

dev
嵇文龙 1 month ago
parent ab26a231b3
commit 42017e6a1b

@ -9,7 +9,7 @@ namespace DS.Module.SqlSugar
{
#region 新增操作 + InsertByObjectForSqlsugar
/// <summary>
/// <summary>
/// 新增操作
/// </summary>
/// <param name="entityInfo"></param>
@ -57,7 +57,7 @@ namespace DS.Module.SqlSugar
entityInfo.SetValue(user.OrgId);
}
if (entityInfo.PropertyName == "CreateBy" && entityInfo.EntityValue == null)
if (entityInfo.PropertyName == "CreateBy" && (entityInfo.EntityValue == null || Equals(entityInfo.EntityValue, 0)))
{
if (!user.UserId.IsNullOrEmpty())
{
@ -112,7 +112,7 @@ namespace DS.Module.SqlSugar
#region 加载配置文件 + ReturnConnectionConfig
public static List<ConnectionConfig> ReturnConnectionConfig(List<DbConfig> dbList,ICacheService cache)
public static List<ConnectionConfig> ReturnConnectionConfig(List<DbConfig> dbList, ICacheService cache)
{
var connectConfigList = new List<ConnectionConfig>();
@ -149,6 +149,6 @@ namespace DS.Module.SqlSugar
#endregion 加载配置文件 + ReturnConnectionConfig
}
}

@ -192,7 +192,7 @@ public static class SqlsugarInstall
entityInfo.SetValue(user.OrgId);
}
if (entityInfo.PropertyName == "CreateBy" && entityInfo.EntityValue == null)
if (entityInfo.PropertyName == "CreateBy" && (entityInfo.EntityValue == null || Equals(entityInfo.EntityValue, 0)))
{
if (!user.UserId.IsNullOrEmpty())
{

Loading…
Cancel
Save