修改BUG:Exception页面查询条件DateTime类型更改为可为空类型

This commit is contained in:
Argo-Surface 2018-11-25 14:28:32 +08:00
parent 21487d2e9a
commit 88037202a8
2 changed files with 7 additions and 7 deletions

View File

@ -13,11 +13,11 @@ namespace Bootstrap.Admin.Query
/// <summary>
///
/// </summary>
public DateTime StartTime { get; set; }
public DateTime? StartTime { get; set; }
/// <summary>
///
/// </summary>
public DateTime EndTime { get; set; }
public DateTime? EndTime { get; set; }
/// <summary>
///
/// </summary>
@ -27,11 +27,11 @@ namespace Bootstrap.Admin.Query
var data = ExceptionsHelper.RetrieveExceptions();
if (StartTime > DateTime.MinValue)
{
data = data.Where(t => t.LogTime > StartTime);
data = data.Where(t => t.LogTime > StartTime.Value);
}
if (EndTime > DateTime.MinValue)
{
data = data.Where(t => t.LogTime < EndTime.AddDays(1));
data = data.Where(t => t.LogTime < EndTime.Value.AddDays(1));
}
var ret = new QueryData<object>();
ret.total = data.Count();

View File

@ -17,11 +17,11 @@ namespace Bootstrap.Admin.Query
/// <summary>
///
/// </summary>
public DateTime OperateTimeStart { get; set; }
public DateTime? OperateTimeStart { get; set; }
/// <summary>
///
/// </summary>
public DateTime OperateTimeEnd { get; set; }
public DateTime? OperateTimeEnd { get; set; }
/// <summary>
///
/// </summary>
@ -40,7 +40,7 @@ namespace Bootstrap.Admin.Query
}
if (OperateTimeEnd > DateTime.MinValue)
{
data = data.Where(t => t.LogTime < OperateTimeEnd.AddDays(1));
data = data.Where(t => t.LogTime < OperateTimeEnd.Value.AddDays(1));
}
var ret = new QueryData<Log>();