u
This commit is contained in:
1 parent
cf23acdabc
commit
2efeb7cee2
13 files changed
+271
-49
No files matched your search
@@ -75,7 +75,8 @@ SELECT
|
||||
COALESCE(mc.member_count, 0) AS member_count,
|
||||
sm.is_default,
|
||||
sm.member_name,
|
||||
sm.sort_number
|
||||
sm.sort_number,
|
||||
s.invite_code
|
||||
FROM space s
|
||||
JOIN space_member sm
|
||||
ON s.id = sm.space_id
|
||||
@@ -85,7 +86,7 @@ FROM space s
|
||||
GROUP BY space_id
|
||||
) mc
|
||||
ON s.id = mc.space_id
|
||||
WHERE sm.user_id = $1 AND s.id = $2
|
||||
WHERE sm.user_id = $1 AND s.id = $2 AND s.status != 2 AND sm.status != 2
|
||||
ORDER BY sm.is_default DESC, sm.sort_number ASC
|
||||
`
|
||||
|
||||
@@ -103,6 +104,7 @@ type GetSpaceByUserIdAndSpaceIdRow struct {
|
||||
IsDefault int16
|
||||
MemberName string
|
||||
SortNumber int32
|
||||
InviteCode string
|
||||
}
|
||||
|
||||
func (q *Queries) GetSpaceByUserIdAndSpaceId(ctx context.Context, arg GetSpaceByUserIdAndSpaceIdParams) (GetSpaceByUserIdAndSpaceIdRow, error) {
|
||||
@@ -117,6 +119,7 @@ func (q *Queries) GetSpaceByUserIdAndSpaceId(ctx context.Context, arg GetSpaceBy
|
||||
&i.IsDefault,
|
||||
&i.MemberName,
|
||||
&i.SortNumber,
|
||||
&i.InviteCode,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
@@ -164,7 +167,7 @@ FROM space s
|
||||
GROUP BY space_id
|
||||
) mc
|
||||
ON s.id = mc.space_id
|
||||
WHERE sm.user_id = $1
|
||||
WHERE sm.user_id = $1 AND s.status != 2 AND sm.status != 2
|
||||
ORDER BY sm.is_default DESC, sm.sort_number ASC
|
||||
`
|
||||
|
||||
|
||||
Reference in new issue
Block a user