Update .net core project

This commit is contained in:
sunkaixuan
2022-09-01 18:57:13 +08:00
parent 0b7ca4a796
commit 50122ef346
2 changed files with 10 additions and 4 deletions

View File

@@ -378,7 +378,7 @@ namespace SqlSugar
{
defaultValue = "";
}
if (defaultValue.IsDate())
if (defaultValue.IsDate() && !AddDefaultValueSql.Contains("'{2}'"))
{
defaultValue = "'" + defaultValue + "'";
}

View File

@@ -114,12 +114,18 @@ namespace SqlSugar
Check.Exception(attribute == null, $"{typeof(T).Name} need SplitTableAttribute");
groupModels = new List<GroupModel>();
var db = FastestProvider.context;
var hasSplitField = typeof(T).GetProperties().Any(it => it.GetCustomAttribute<SplitFieldAttribute>() != null);
foreach (var item in datas)
{
if (groupModels.Count > 0 && !hasSplitField)
groupModels.Add(new GroupModel() { GroupName = groupModels[0].GroupName, Item = item });
else
{
var value = db.SplitHelper<T>().GetValue(attribute.SplitType, item);
var tableName = db.SplitHelper<T>().GetTableName(attribute.SplitType, value);
groupModels.Add(new GroupModel() { GroupName = tableName, Item = item });
}
}
result = 0;
}
internal class GroupModel