优化用户资料卡成就摘要查询

This commit is contained in:
pllx
2026-04-30 16:45:46 +08:00
parent ffd8789e67
commit 82dbc19319
3 changed files with 45 additions and 8 deletions
+2 -8
View File
@@ -161,14 +161,8 @@ class UserController extends Controller
'expires_at' => $signIdentity->expires_at?->toIso8601String(),
] : null,
];
// 名片展示前先静默补算一次,避免进度已达标但解锁记录尚未落库
$this->achievementService->scanUser($targetUser);
$achievementDisplay = $this->achievementService->displayForUser($targetUser);
$data['achievements'] = [
'unlocked_count' => $achievementDisplay['unlocked_count'],
'total_count' => $achievementDisplay['total_count'],
'recent' => $this->achievementService->recentUnlockedForUser($targetUser, 5)->values()->all(),
];
// 名片弹窗只读取已缓存的成就摘要,避免双击用户时同步扫描全量日志造成卡顿
$data['achievements'] = $this->achievementService->profileSummaryForUser($targetUser);
// 管理员网络信息仅对站长或拥有「封IP」职务权限的操作者展示。
$canViewNetworkInfo = $operator