Skip to content

Commit

Permalink
修复Paginate翻页偏移问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tobycroft committed Jun 16, 2022
1 parent e2ad0d1 commit 415ac09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion orm_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,15 @@ func (dba *Orm) Paginate(page ...int) (res Data, err error) {
}
var offset = dba.GetOffset()
var currentPage = int(math.Ceil(float64(offset+1) / float64(limit)))
//dba.ResetUnion()
// 统计总量
dba.offset = 0
tabname := dba.GetISession().GetIBinder().GetBindName()
prefix := dba.GetISession().GetIBinder().GetBindPrefix()
resData, err := dba.Get()
if err != nil {
return
}
dba.offset = 0
dba.GetISession().GetIBinder().SetBindName(tabname)
dba.GetISession().GetIBinder().SetBindPrefix(prefix)
count, err := dba.Count()
Expand Down

0 comments on commit 415ac09

Please sign in to comment.