新增潜水排行

This commit is contained in:
liuwei
2026-01-20 17:05:00 +08:00
parent e5471bc024
commit 05949bdf67
2 changed files with 15 additions and 4 deletions

View File

@@ -724,6 +724,7 @@ class ContactsDBOperator(BaseDBOperator):
WHEN latest_active_time IS NULL THEN 999999
ELSE TIMESTAMPDIFF(DAY, latest_active_time, NOW())
END AS inactivity_days
, CASE WHEN latest_active_time IS NULL THEN 1 ELSE 0 END AS never_spoken
FROM t_chatroom_member
WHERE chatroom_id = %s
AND (latest_active_time IS NULL OR latest_active_time <= DATE_SUB(NOW(), INTERVAL %s DAY))