replace zxq.co/ripple/hanayo

This commit is contained in:
Alicia
2019-02-23 13:29:15 +00:00
commit c3d206c173
5871 changed files with 1353715 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package common
import "fmt"
// Paginate creates an additional SQL LIMIT clause for paginating.
func Paginate(page, limit string, maxLimit int) string {
var (
p = Int(page)
l = Int(limit)
)
if p < 1 {
p = 1
}
if l < 1 {
l = 50
}
if l > maxLimit {
l = maxLimit
}
start := uint(p-1) * uint(l)
return fmt.Sprintf(" LIMIT %d,%d ", start, l)
}