Browse Source

fix:修改图表排序

zqbao 9 months ago
parent
commit
7b5c139f8d
1 changed files with 1 additions and 1 deletions
  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) {
 func GetMyChartListById(userId int, startSize, pageSize int) (items []*MyChart, err error) {
 	o := orm.NewOrm()
 	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)
 	_, err = o.Raw(sql, userId, startSize, pageSize).QueryRows(&items)
 	return
 	return
 }
 }