diff --git a/ZR.Admin.WebApi/Controllers/System/monitor/SysOperlogController.cs b/ZR.Admin.WebApi/Controllers/System/monitor/SysOperlogController.cs index 7200207..756d307 100644 --- a/ZR.Admin.WebApi/Controllers/System/monitor/SysOperlogController.cs +++ b/ZR.Admin.WebApi/Controllers/System/monitor/SysOperlogController.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using ZR.Admin.WebApi.Extensions; using ZR.Admin.WebApi.Filters; using ZR.Model.System.Dto; @@ -15,12 +14,10 @@ namespace ZR.Admin.WebApi.Controllers.monitor public class SysOperlogController : BaseController { private ISysOperLogService sysOperLogService; - private IWebHostEnvironment WebHostEnvironment; - public SysOperlogController(ISysOperLogService sysOperLogService, IWebHostEnvironment hostEnvironment) + public SysOperlogController(ISysOperLogService sysOperLogService) { this.sysOperLogService = sysOperLogService; - WebHostEnvironment = hostEnvironment; } /// diff --git a/ZR.ServiceCore/Services/SysOperLogService.cs b/ZR.ServiceCore/Services/SysOperLogService.cs index 7fb5cc9..48c1b55 100644 --- a/ZR.ServiceCore/Services/SysOperLogService.cs +++ b/ZR.ServiceCore/Services/SysOperLogService.cs @@ -34,14 +34,16 @@ namespace ZR.ServiceCore.Services public PagedInfo SelectOperLogList(SysOperLogQueryDto sysOper) { var exp = Expressionable.Create(); - exp.And(it => it.OperTime >= sysOper.BeginTime && it.OperTime <= sysOper.EndTime); + exp.AndIF(sysOper.BeginTime == null, it => it.OperTime >= DateTime.Now.ToShortDateString().ParseToDateTime()); + exp.AndIF(sysOper.BeginTime != null, it => it.OperTime >= sysOper.BeginTime && it.OperTime <= sysOper.EndTime); exp.AndIF(sysOper.Title.IfNotEmpty(), it => it.Title.Contains(sysOper.Title)); exp.AndIF(sysOper.OperName.IfNotEmpty(), it => it.OperName.Contains(sysOper.OperName)); exp.AndIF(sysOper.BusinessType != -1, it => it.BusinessType == sysOper.BusinessType); exp.AndIF(sysOper.Status != -1, it => it.Status == sysOper.Status); exp.AndIF(sysOper.OperParam != null, it => it.OperParam.Contains(sysOper.OperParam)); - return Queryable().Where(exp.ToExpression()) + return Queryable() + .Where(exp.ToExpression()) .OrderBy(x => x.OperId, OrderByType.Desc) .ToPage(sysOper); }