Skip to content

Commit

Permalink
Merge pull request #63 from armingli/armingli-patch-Limit
Browse files Browse the repository at this point in the history
优化Limit的调用
  • Loading branch information
xormplus authored Mar 12, 2020
2 parents 797ac8a + be8b1dc commit 935be4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ func (statement *Statement) Top(limit int) *Statement {

// Limit generate LIMIT start, limit statement
func (statement *Statement) Limit(limit int, start ...int) *Statement {
statement.LimitN = &limit
if limit > 0 {
statement.LimitN = &limit
}
if len(start) > 0 {
statement.Start = start[0]
}
Expand Down

0 comments on commit 935be4f

Please sign in to comment.