From 3fd2cf6f6b437f95c55ee6adbfbd66ee0c6ad265 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Sun, 7 Apr 2024 19:05:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=AE=B0=E5=BD=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5:=20=E6=9C=80=E5=A4=A7=E8=BF=9E?= =?UTF-8?q?=E7=BB=AD=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/CheckIn.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/models/CheckIn.ts b/src/models/CheckIn.ts index 2067cde..525fc21 100644 --- a/src/models/CheckIn.ts +++ b/src/models/CheckIn.ts @@ -30,6 +30,9 @@ export class CheckInClass extends BaseModule { // 连签天数 @prop({ default: 1 }) public count: number + // 最大连签天数 + @prop({ default: 1 }) + public maxSeq: number @prop({ default: 1 }) public total: number @prop() @@ -45,6 +48,7 @@ export class CheckInClass extends BaseModule { } const total = await CheckIn.countDocuments({ from: event.from }) event.total = total + 1 + event.maxSeq = Math.max(event.count, event.maxSeq || 1) try { await CheckIn.insertOrUpdate({ from: event.from, dateTag: event.dateTag }, event) } catch (err) {