fix limit, offset bugs
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user