From d1257f0fe9341a443491ec3983da4089baac22ef Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- initdatas/activity_info.json | 6 +++--- src/controllers/game.controller.ts | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/initdatas/activity_info.json b/initdatas/activity_info.json index bec0186..704ea55 100644 --- a/initdatas/activity_info.json +++ b/initdatas/activity_info.json @@ -32,7 +32,7 @@ "start": "2024-01-01 00:00", "end": "2025-01-01 00:00", "checkChain": true, - "params": {"time": 6, "failRate": 60} + "params": {"time": 6, "failRate": 0} }, { "id": "e2feyflj30vwcpe0sjy", "task": "TwitterFollow", @@ -47,7 +47,7 @@ "start": "2024-01-01 00:00", "end": "2025-01-01 00:00", "checkChain": true, - "params": {"time": 6, "failRate": 60} + "params": {"time": 6, "failRate": 0} }, { "id": "e2fuah0j30vwcpe0my7", "task": "TwitterRetweet", @@ -62,7 +62,7 @@ "start": "2024-01-01 00:00", "end": "2025-01-01 00:00", "checkChain": true, - "params": {"time": 6, "failRate": 60} + "params": {"time": 6, "failRate": 0} } ], "startTime": 1711086450119, diff --git a/src/controllers/game.controller.ts b/src/controllers/game.controller.ts index 2df7d3c..6189498 100644 --- a/src/controllers/game.controller.ts +++ b/src/controllers/game.controller.ts @@ -63,6 +63,11 @@ class GameController extends BaseController { days = '1month' } else if (tag === 'last') { days = '1' + } else if (tag === 'all') { + const start = new Date(req.activity.start).getTime() + // calc days from start to now + const now = new Date().getTime() + days = Math.floor((now - start) / 86400000) } const res = await queryCheckInList(user.address.toLowerCase(), days, 0) return res