Browse Source

修改知识库超期更新bug

tangjiang 1 day ago
parent
commit
b92f2f11db
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/Hotline.Application/Knowledge/KnowApplication.cs

+ 3 - 2
src/Hotline.Application/Knowledge/KnowApplication.cs

@@ -523,14 +523,15 @@ namespace Hotline.Application.Knowledge
                     .WhereIF(dto.StartTime.HasValue, p => p.LastModificationTime >= dto.StartTime)
                     .WhereIF(dto.StartTime.HasValue, p => p.LastModificationTime >= dto.StartTime)
                     .WhereIF(dto.EndTime.HasValue, p => p.LastModificationTime <= dto.EndTime)
                     .WhereIF(dto.EndTime.HasValue, p => p.LastModificationTime <= dto.EndTime)
                     .WhereIF(!string.IsNullOrEmpty(dto.Keyword), p => p.SourceOrganize.Name.Contains(dto.Keyword))
                     .WhereIF(!string.IsNullOrEmpty(dto.Keyword), p => p.SourceOrganize.Name.Contains(dto.Keyword))
+                    .OrderBy(p => new { p.SourceOrganize, p.LastModificationTime })
                     .Select(p => new KnowedgeStatisticsDto
                     .Select(p => new KnowedgeStatisticsDto
                     {
                     {
-                       Index= SqlFunc.RowNumber($"{p.LastModificationTime} desc "),
+                        Index = SqlFunc.RowNumber($"{p.LastModificationTime} desc "),
                         LastModificationTime = p.LastModificationTime,
                         LastModificationTime = p.LastModificationTime,
                         OrgName = p.SourceOrganize.Name
                         OrgName = p.SourceOrganize.Name
                     })
                     })
                     .MergeTable()
                     .MergeTable()
-                    .Where(p=>p.Index==1)
+                    .Where(p => p.Index == 1)
                     .OrderByDescending(p => p.LastModificationTime);
                     .OrderByDescending(p => p.LastModificationTime);
         }
         }
     }
     }