feat: 完成独立的邀请与达人榜系统架构

This commit is contained in:
2026-03-12 09:33:38 +08:00
parent af1d1c5ace
commit 0ab0483603
9 changed files with 300 additions and 4 deletions

View File

@@ -66,6 +66,12 @@ class UserController extends Controller
$data['meili'] = $targetUser->meili ?? 0;
}
// 仅当自己看自己时,附加邀请相关信息,用于展示专属邀请链接
if ($operator && $operator->id === $targetUser->id) {
$data['id'] = $targetUser->id;
$data['invitees_count'] = $targetUser->invitees()->count();
}
// 职务履历所有任职记录按任命时间倒序positions() 关系已含 with
$data['position_history'] = $targetUser->positions
->map(fn ($up) => [