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 = "";
|
defaultValue = "";
|
||||||
}
|
}
|
||||||
if (defaultValue.IsDate())
|
if (defaultValue.IsDate() && !AddDefaultValueSql.Contains("'{2}'"))
|
||||||
{
|
{
|
||||||
defaultValue = "'" + defaultValue + "'";
|
defaultValue = "'" + defaultValue + "'";
|
||||||
}
|
}
|
||||||
|
@@ -114,11 +114,17 @@ namespace SqlSugar
|
|||||||
Check.Exception(attribute == null, $"{typeof(T).Name} need SplitTableAttribute");
|
Check.Exception(attribute == null, $"{typeof(T).Name} need SplitTableAttribute");
|
||||||
groupModels = new List<GroupModel>();
|
groupModels = new List<GroupModel>();
|
||||||
var db = FastestProvider.context;
|
var db = FastestProvider.context;
|
||||||
|
var hasSplitField = typeof(T).GetProperties().Any(it => it.GetCustomAttribute<SplitFieldAttribute>() != null);
|
||||||
foreach (var item in datas)
|
foreach (var item in datas)
|
||||||
{
|
{
|
||||||
var value = db.SplitHelper<T>().GetValue(attribute.SplitType, item);
|
if (groupModels.Count > 0 && !hasSplitField)
|
||||||
var tableName = db.SplitHelper<T>().GetTableName(attribute.SplitType,value);
|
groupModels.Add(new GroupModel() { GroupName = groupModels[0].GroupName, Item = item });
|
||||||
groupModels.Add(new GroupModel() { GroupName = tableName, 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;
|
result = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user