Explorar o código

fix:修改图表排序

zqbao hai 9 meses
pai
achega
7b5c139f8d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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
 }