Commit 4c00d6d8 authored by CodeFever888's avatar CodeFever888
Browse files

'sever'

parent 899547a6
...@@ -81,7 +81,7 @@ func getHandler(w http.ResponseWriter, r *http.Request) { ...@@ -81,7 +81,7 @@ func getHandler(w http.ResponseWriter, r *http.Request) {
var comments []Comment var comments []Comment
var total int64 var total int64
db.Model(&Comment{}).Count(&total) db.Model(&Comment{}).Count(&total)
db.Offset((pageInt - 1) * sizeInt).Limit(sizeInt).Find(&comments) db.Order("id desc").Offset((pageInt - 1) * sizeInt).Limit(sizeInt).Find(&comments)
response := Response{ response := Response{
Code: 0, Code: 0,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment