diff --git a/message_report/write_db.py b/message_report/write_db.py index 7188b5f..0830276 100644 --- a/message_report/write_db.py +++ b/message_report/write_db.py @@ -55,7 +55,7 @@ def generate_and_send_ranking(groupId, allContacts: dict): query = """ SELECT wx_id, count AS speech_count FROM speech_counts - WHERE DATE(date) = DATE('now', '-1 day') + WHERE DDATE_FORMAT(DATE_SUB('2025-01-01', INTERVAL 1 DAY), '%Y-%m-%d') AND group_id = %s GROUP BY wx_id ORDER BY count DESC