From e39cc55b03be86a3de33e04cd7bc76d7e05e9ba5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 13 Jun 2020 12:57:46 +0800 Subject: [PATCH] Fix bug --- session_find.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/session_find.go b/session_find.go index 90c2b6dc..642093f2 100644 --- a/session_find.go +++ b/session_find.go @@ -63,6 +63,9 @@ func (session *Session) FindAndCount(rowsSlicePtr interface{}, condiBean ...inte if session.statement.LimitN != nil { session.statement.LimitN = nil } + if session.statement.Start > 0 { + session.statement.Start = 0 + } // session has stored the conditions so we use `unscoped` to avoid duplicated condition. return session.Unscoped().Count(reflect.New(sliceElementType).Interface())