feat: entgo query .

This commit is contained in:
tx7do
2023-10-25 14:28:29 +08:00
parent 798ccd50d6
commit f8eedb020b
4 changed files with 187 additions and 52 deletions

View File

@@ -3,7 +3,7 @@ package entgo
import (
"entgo.io/ent/dialect/sql"
"github.com/tx7do/kratos-utils/pagination"
paging "restroom-system/pkg/util/pagination"
)
func BuildPaginationSelector(page, pageSize int32, noPaging bool) func(*sql.Selector) {
@@ -20,7 +20,7 @@ func BuildPaginationSelector(page, pageSize int32, noPaging bool) func(*sql.Sele
}
return func(s *sql.Selector) {
s.Offset(pagination.GetPageOffset(page, pageSize)).
s.Offset(paging.GetPageOffset(page, pageSize)).
Limit(int(pageSize))
}
}