Skip to content

Commit

Permalink
feat(badge): delete useless field
Browse files Browse the repository at this point in the history
  • Loading branch information
kumfo committed Sep 3, 2024
1 parent 70acbe3 commit a36d2e8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion internal/entity/badge_award_entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func (BadgeEarnedCount) TableName() string {

type BadgeAwardRecent struct {
Created time.Time `xorm:"created"`
UserID string `xorm:"user_id"`
BadgeID string `xorm:"badge_id"`
AwardKey string `xorm:"award_key"`
EarnedCount int64 `xorm:"earned_count"`
Expand Down
2 changes: 1 addition & 1 deletion internal/repo/badge_award/badge_award_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (r *badgeAwardRepo) ListPagedByBadgeIdAndUserId(ctx context.Context, badgeI
func (r *badgeAwardRepo) ListNewestEarned(ctx context.Context, userID string, limit int) (badgeAwards []*entity.BadgeAwardRecent, err error) {
badgeAwards = make([]*entity.BadgeAwardRecent, 0)
err = r.data.DB.Context(ctx).
Select("any_value(user_id), badge_id, max(created_at) created,count(*) earned_count").
Select("badge_id, max(created_at) created,count(*) earned_count").
Where("user_id = ? AND is_badge_deleted = ? ", userID, entity.IsBadgeNotDeleted).
GroupBy("badge_id").
OrderBy("created desc").
Expand Down

0 comments on commit a36d2e8

Please sign in to comment.