fix: 修复等级排序问题

This commit is contained in:
橙子
2024-08-12 20:05:42 +08:00
parent b4de38fbb9
commit c122863e45

View File

@@ -19,8 +19,10 @@ namespace Yi.Framework.Bbs.Domain.Managers
private IDistributedCache<List<LevelCacheItem>> _levelCache; private IDistributedCache<List<LevelCacheItem>> _levelCache;
private IRepository<LevelAggregateRoot> _repository; private IRepository<LevelAggregateRoot> _repository;
private ISqlSugarRepository<BbsUserExtraInfoEntity> _bbsUserRepository; private ISqlSugarRepository<BbsUserExtraInfoEntity> _bbsUserRepository;
public LevelManager(ILocalEventBus localEventBus, public LevelManager(ILocalEventBus localEventBus,
IDistributedCache<List<LevelCacheItem>> levelCache, IRepository<LevelAggregateRoot> repository, ISqlSugarRepository<BbsUserExtraInfoEntity> bbsUserRepository) IDistributedCache<List<LevelCacheItem>> levelCache, IRepository<LevelAggregateRoot> repository,
ISqlSugarRepository<BbsUserExtraInfoEntity> bbsUserRepository)
{ {
_localEventBus = localEventBus; _localEventBus = localEventBus;
_repository = repository; _repository = repository;
@@ -63,7 +65,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
false); false);
//更改最终的经验再变化等级 //更改最终的经验再变化等级
var levelList = (await GetCacheMapAsync()).Values; var levelList = (await GetCacheMapAsync()).Values.OrderByDescending(x => x.CurrentLevel);
var currentNewLevel = 1; var currentNewLevel = 1;
foreach (var level in levelList) foreach (var level in levelList)
{ {