Skip to content

Commit e198c47

Browse files
committed
授業の登録も興味分野の登録も 0 件のユーザは除外
1 parent ca6b4cc commit e198c47

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

server/prisma/sql/recommend.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,18 @@ AND NOT EXISTS (
2626
AND status = 'PENDING'
2727
)
2828

29+
-- 授業の登録も興味分野の登録も 0 件のユーザは除外
30+
AND (
31+
EXISTS (
32+
SELECT 1 FROM "Enrollment" e
33+
WHERE e."userId" = recv.id
34+
)
35+
OR
36+
EXISTS (
37+
SELECT 1 FROM "Interest" i
38+
WHERE i."userId" = recv.id
39+
)
40+
)
41+
2942
ORDER BY overlap DESC
3043
LIMIT $2 OFFSET $3;

0 commit comments

Comments
 (0)