签到列表增加规则

This commit is contained in:
CounterFire2023 2024-04-11 10:06:57 +08:00
parent 366199b056
commit d1257f0fe9
2 changed files with 8 additions and 3 deletions

View File

@ -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,

View File

@ -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