diff --git a/src/Coldairarrow.Business/HuiYan/catsBusiness.cs b/src/Coldairarrow.Business/HuiYan/catsBusiness.cs index 674bbb3..538ddd6 100644 --- a/src/Coldairarrow.Business/HuiYan/catsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/catsBusiness.cs @@ -76,7 +76,10 @@ namespace Coldairarrow.Business.HuiYan CreatorId = "admin", Deleted = false, Name = model.OneCat.Text, - ParentId = null + ParentId = null, + LastShowJDTime = DateTime.MinValue, + LastShowPddTime = DateTime.MinValue, + LastShowTBTime = DateTime.MinValue }; int row = Db.Insert(oneCat); @@ -104,7 +107,10 @@ namespace Coldairarrow.Business.HuiYan CreatorId = "admin", Deleted = false, Name = model.TwoCat.Text, - ParentId = oneCat.Id + ParentId = oneCat.Id, + LastShowJDTime = DateTime.MinValue, + LastShowPddTime = DateTime.MinValue, + LastShowTBTime = DateTime.MinValue }; int row= Db.Insert(twoCat); @@ -132,7 +138,10 @@ namespace Coldairarrow.Business.HuiYan CreatorId = "admin", Deleted = false, Name = model.LastCat.Text, - ParentId = twoCat.Id + ParentId = twoCat.Id, + LastShowJDTime = DateTime.MinValue, + LastShowPddTime = DateTime.MinValue, + LastShowTBTime = DateTime.MinValue }; int row = Db.Insert(lastCat); @@ -151,7 +160,10 @@ namespace Coldairarrow.Business.HuiYan CreatorId = "admin", Deleted = false, Name = key, - ParentId = lastCat.Id + ParentId = lastCat.Id, + LastShowJDTime=DateTime.MinValue, + LastShowPddTime=DateTime.MinValue, + LastShowTBTime=DateTime.MinValue }); }); @@ -211,7 +223,7 @@ namespace Coldairarrow.Business.HuiYan public async Task> GetTreeDataListAsync() { - var where = LinqHelper.True().And(c => c.Type == 0 || c.TeamId== _operator.TeamId); + var where = LinqHelper.True().And(c => c.Type == 0 || c.TeamId == _operator.TeamId); var list = await GetIQueryable().Where(where).ToListAsync(); var treeList = list @@ -222,7 +234,7 @@ namespace Coldairarrow.Business.HuiYan Text = x.Name, Value = x.Id, Type = x.Type, - IsShowJDTime= x.LastShowJDTime==null?true:(DateTime.Now- x.LastShowJDTime.Value).TotalDays>3, + IsShowJDTime = x.LastShowJDTime == null ? true : (DateTime.Now - x.LastShowJDTime.Value).TotalDays > 3, IsShowPddTime = x.LastShowPddTime == null ? true : (DateTime.Now - x.LastShowPddTime.Value).TotalDays > 3, IsShowTBTime = x.LastShowTBTime == null ? true : (DateTime.Now - x.LastShowTBTime.Value).TotalDays > 3, }).ToList(); @@ -253,8 +265,11 @@ namespace Coldairarrow.Business.HuiYan //设置为团队库 Type = model.Type, //暂时没有登录信息 - TeamId = _operator.TeamId - + TeamId = _operator.TeamId, + LastShowJDTime = DateTime.MinValue, + LastShowPddTime = DateTime.MinValue, + LastShowTBTime = DateTime.MinValue + }; int row = Db.Insert(cat);