fix limit, offset bugs
This commit is contained in:
@@ -109,8 +109,8 @@ func (q *SelectQuery) RightJoin(def string) *SelectQuery {
|
|||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *SelectQuery) Offset(limit int) *SelectQuery {
|
func (q *SelectQuery) Offset(offset int) *SelectQuery {
|
||||||
q.limit = limit
|
q.offset = offset
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ func (q *SelectQuery) String() string {
|
|||||||
|
|
||||||
if q.limit > 0 {
|
if q.limit > 0 {
|
||||||
if q.offset > 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 {
|
} else {
|
||||||
strs = append(strs, fmt.Sprintf("limit %d", q.limit))
|
strs = append(strs, fmt.Sprintf("limit %d", q.limit))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user