浏览代码

fix:修改图表排序

zqbao 9 月之前
父节点
当前提交
7b5c139f8d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      models/my_chart.go

+ 1 - 1
models/my_chart.go

@@ -40,7 +40,7 @@ func GetMyChartListCountById(userId int) (count int, err error) {
 
 func GetMyChartListById(userId int, startSize, pageSize int) (items []*MyChart, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM my_chart WHERE user_id=? ORDER BY create_time LIMIT ?,?`
+	sql := `SELECT * FROM my_chart WHERE user_id=? ORDER BY create_time DESC LIMIT ?,?`
 	_, err = o.Raw(sql, userId, startSize, pageSize).QueryRows(&items)
 	return
 }