fix limit, offset bugs

This commit is contained in:
2026-07-10 08:35:15 +01:00
parent 86468a85c9
commit 260506352f
+3 -3
View File
@@ -109,8 +109,8 @@ func (q *SelectQuery) RightJoin(def string) *SelectQuery {
return q
}
func (q *SelectQuery) Offset(limit int) *SelectQuery {
q.limit = limit
func (q *SelectQuery) Offset(offset int) *SelectQuery {
q.offset = offset
return q
}
@@ -215,7 +215,7 @@ func (q *SelectQuery) String() string {
if q.limit > 0 {
if q.offset > 0 {
strs = append(strs, fmt.Sprintf("limit %d offset %d", q.offset, q.limit))
strs = append(strs, fmt.Sprintf("limit %d offset %d", q.limit, q.offset))
} else {
strs = append(strs, fmt.Sprintf("limit %d", q.limit))
}