2024-08-28 20:15:26 +08:00
|
|
|
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, tm.created, tm.updated, tm.permission
|
|
|
|
|
FROM {{ .Ident .TeamMemberTable }} tm
|
2024-08-27 14:31:29 +08:00
|
|
|
INNER JOIN {{ .Ident .TeamTable }} t ON tm.team_id = t.id
|
|
|
|
|
INNER JOIN {{ .Ident .UserTable }} u ON tm.user_id = u.id
|
|
|
|
|
WHERE
|
2025-10-03 21:48:51 +08:00
|
|
|
tm.org_id = {{ .Arg .Query.OrgID}}
|
|
|
|
|
{{ if .Query.UID }}
|
|
|
|
|
AND t.uid = {{ .Arg .Query.UID }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{- if .Query.Pagination.Continue }}
|
|
|
|
|
AND tm.id >= {{ .Arg .Query.Pagination.Continue }}
|
|
|
|
|
{{- end }}
|
2024-08-28 16:30:23 +08:00
|
|
|
AND NOT tm.external
|
2025-10-03 21:48:51 +08:00
|
|
|
ORDER BY t.id ASC
|
|
|
|
|
LIMIT {{ .Arg .Query.Pagination.Limit }};
|