fix: 通知列表查询的数据不准确的问题

This commit is contained in:
KAI
2025-04-07 14:32:54 +08:00
parent 6d58a3b7dd
commit 7cb34b3aa5

View File

@@ -10,7 +10,7 @@
WHERE (effective_time IS NULL OR NOW() > effective_time)
AND (terminate_time IS NULL OR terminate_time > NOW())
<if test="userId != null">
AND (notice_scope = 1 OR (notice_scope = 2 AND JSON_EXTRACT(notice_users, "$[0]") = CAST(#{userId} AS CHAR)))
AND (notice_scope = 1 OR (notice_scope = 2 AND JSON_CONTAINS(notice_users, CONCAT('"', #{userId}, '"'))))
</if>
ORDER BY sort ASC, effective_time DESC
LIMIT 5