增加查看签到排名 (#180)

*  增加查看签到排名

* 🚨 修lint

* 🚨 修lint
This commit is contained in:
himawari
2022-04-06 10:59:56 +08:00
committed by GitHub
parent a6bd717971
commit 9b26eea754
6 changed files with 83 additions and 1 deletions

View File

@@ -117,3 +117,9 @@ func (sdb *scoredb) InsertOrUpdateSignInCountByUID(uid int64, count int) (err er
}
return
}
func (sdb *scoredb) GetScoreRankByTopN(n int) (st []scoretable, err error) {
db := (*gorm.DB)(sdb)
err = db.Debug().Model(&scoretable{}).Order("score desc").Limit(n).Find(&st).Error
return
}