日志查询条件

optimize
wanghaomei 2 years ago
parent ec467e8863
commit 8f120b9e29

@ -8,7 +8,7 @@ namespace Myshipping.Core.Service;
public class OpLogInput : PageInputBase public class OpLogInput : PageInputBase
{ {
/// <summary> /// <summary>
/// 名称 /// 操作人名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
@ -83,7 +83,7 @@ public class OpLogInput : PageInputBase
public DateTime OpTime { get; set; } public DateTime OpTime { get; set; }
/// <summary> /// <summary>
/// 操作人 /// 操作人账号
/// </summary> /// </summary>
public string Account { get; set; } public string Account { get; set; }
} }

@ -34,6 +34,9 @@ public class SysOpLogService : ISysOpLogService, IDynamicApiController, ITransie
{ {
var opLogs = await _sysOpLogRep.AsQueryable() var opLogs = await _sysOpLogRep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Name.Contains(input.Account.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Ip), u => u.Name.Contains(input.Ip.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Url), u => u.Name.Contains(input.Url.Trim()))
.WhereIF(Enum.IsDefined(typeof(YesOrNot),input.Success), u => u.Success == input.Success) .WhereIF(Enum.IsDefined(typeof(YesOrNot),input.Success), u => u.Success == input.Success)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchBeginTime), u => u.OpTime >= DateTime.Parse(input.SearchBeginTime.Trim()) && u.OpTime <= DateTime.Parse(input.SearchEndTime.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.SearchBeginTime), u => u.OpTime >= DateTime.Parse(input.SearchBeginTime.Trim()) && u.OpTime <= DateTime.Parse(input.SearchEndTime.Trim()))
.OrderBy(u => u.Id, OrderByType.Desc) .OrderBy(u => u.Id, OrderByType.Desc)

Loading…
Cancel
Save