mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Update .net core project
This commit is contained in:
@@ -378,7 +378,7 @@ namespace SqlSugar
|
||||
{
|
||||
defaultValue = "";
|
||||
}
|
||||
if (defaultValue.IsDate())
|
||||
if (defaultValue.IsDate() && !AddDefaultValueSql.Contains("'{2}'"))
|
||||
{
|
||||
defaultValue = "'" + defaultValue + "'";
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user