feat(scum): rebuild plugin-owned management data

This commit is contained in:
npc0-hue
2026-08-15 12:43:09 +08:00
parent 92b1159cc8
commit 65353cf269
113 changed files with 3116 additions and 8058 deletions
@@ -0,0 +1,15 @@
SELECT
CAST(member.squad_id AS TEXT) AS squadId,
CAST(member.user_profile_id AS TEXT) AS userProfileId,
CAST(profile.prisoner_id AS TEXT) AS gamePlayerId,
account.id AS steamId,
COALESCE(profile.name, account.name, '') AS displayName,
CAST(member.rank AS TEXT) AS rank,
CASE WHEN member.rank = 4 THEN 1 ELSE 0 END AS isLeader
FROM squad_member member
JOIN user_profile profile ON profile.id = member.user_profile_id
LEFT JOIN user account ON account.id = profile.user_id
WHERE (:squadId IS NULL OR CAST(member.squad_id AS TEXT) = :squadId)
AND (:userProfileId IS NULL OR CAST(member.user_profile_id AS TEXT) = :userProfileId)
ORDER BY member.squad_id, member.rank DESC, profile.name
LIMIT COALESCE(:limit, 500)