🐛 Fix activating badges

This commit is contained in:
2025-03-02 21:04:24 +08:00
parent bc31a94c98
commit 53d856c7a7
4 changed files with 7 additions and 6 deletions

View File

@ -44,7 +44,7 @@ func getOtherUserinfo(c *fiber.Ctx) error {
if err := tx.
Preload("Profile").
Preload("Badges", func(db *gorm.DB) *gorm.DB {
return db.Order("badges.type DESC")
return db.Order("badges.is_active DESC, badges.type DESC")
}).
First(&account).Error; err != nil {
return fiber.NewError(fiber.StatusBadRequest, err.Error())