Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#862 from cnlkl/issue_861
Browse files Browse the repository at this point in the history
bug: 修复分页获取扫描方案总数量字段错误 TencentBlueKing#861
  • Loading branch information
owenlxu authored Jul 5, 2023
2 parents 9269b08 + 085701b commit 36a9f88
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ class ScanPlanDao : ScannerSimpleMongoDao<TScanPlan>() {
type?.let { criteria.and(TScanPlan::type.name).isEqualTo(type) }
planNameContains?.let { criteria.and(TScanPlan::name.name).regex(".*$planNameContains.*") }
val pageRequest = Pages.ofRequest(pageLimit.getNormalizedPageNumber(), pageLimit.getNormalizedPageSize())
val query = Query(criteria).with(pageRequest).with(Sort.by(TScanPlan::createdDate.name).descending())
val query = Query(criteria).with(Sort.by(TScanPlan::createdDate.name).descending())

return Pages.ofResponse(pageRequest, count(query), find(query))
return Pages.ofResponse(pageRequest, count(query), find(query.with(pageRequest)))
}

fun page(pageLimit: PageLimit? = null): List<TScanPlan> {
Expand Down

0 comments on commit 36a9f88

Please sign in to comment.