fix sql pager

This commit is contained in:
stremovsky
2019-12-14 22:38:57 +02:00
parent 77aee8df94
commit 11f774c3f1

View File

@@ -504,8 +504,8 @@ func (dbobj dbcon) getList(t Tbl, keyName string, keyValue string, start int32,
q := "select * from " + table + " WHERE " + keyName + "=$1"
if start > 0 {
q = q + " LIMIT " + strconv.FormatInt(int64(start), 10) + "," +
strconv.FormatInt(int64(limit), 10)
q = q + " LIMIT " + strconv.FormatInt(int64(limit), 10) +
" OFFSET " + strconv.FormatInt(int64(start), 10)
} else if limit > 0 {
q = q + " LIMIT " + strconv.FormatInt(int64(limit), 10)
}