修改orderby位置,解决排序错误问题

main
潘建东 11 months ago
parent 871a8a235a
commit 65d1052b32

@ -313,9 +313,10 @@ namespace ZhongLianService
.WhereIF(pageSearch.Mode != null && !string.IsNullOrEmpty(pageSearch.Mode.PatrolUid), x => .WhereIF(pageSearch.Mode != null && !string.IsNullOrEmpty(pageSearch.Mode.PatrolUid), x =>
x.PatrolUid == pageSearch.Mode!.PatrolUid x.PatrolUid == pageSearch.Mode!.PatrolUid
) )
.OrderByDescending(x => x.Id)
.SplitTable((DateTime)pageSearch.StartDate!, (DateTime)pageSearch.EndDate!) .SplitTable((DateTime)pageSearch.StartDate!, (DateTime)pageSearch.EndDate!)
.OrderByDescending(x => x.Id)
.ToPageListAsync(pageSearch.Index, pageSearch.Size, _Total); .ToPageListAsync(pageSearch.Index, pageSearch.Size, _Total);
return new PageData<InstallDO>() return new PageData<InstallDO>()
{ {
Index = pageSearch.Index, Index = pageSearch.Index,

@ -146,9 +146,9 @@ namespace ZhongLianService
.WhereIF(pageSearch.Mode != null && !string.IsNullOrEmpty(pageSearch.Mode.MaintenanceUid), x => .WhereIF(pageSearch.Mode != null && !string.IsNullOrEmpty(pageSearch.Mode.MaintenanceUid), x =>
x.MaintenanceUid == pageSearch.Mode!.MaintenanceUid x.MaintenanceUid == pageSearch.Mode!.MaintenanceUid
) )
.SplitTable((DateTime)pageSearch.StartDate!, (DateTime)pageSearch.EndDate!)
.OrderBy("(CASE State WHEN 2 THEN 0 ELSE State END) ASC") .OrderBy("(CASE State WHEN 2 THEN 0 ELSE State END) ASC")
.OrderByDescending(x => x.Id) .OrderByDescending(x => x.Id)
.SplitTable((DateTime)pageSearch.StartDate!, (DateTime)pageSearch.EndDate!)
.ToPageListAsync(pageSearch.Index, pageSearch.Size, _Total); .ToPageListAsync(pageSearch.Index, pageSearch.Size, _Total);
return new PageData<MaintenanceDO>() return new PageData<MaintenanceDO>()
{ {

Loading…
Cancel
Save