From 2e2c9a9242d53980e2ca5d4154633b70cb2bfe2d Mon Sep 17 00:00:00 2001 From: guanchao <18612113337@163.com> Date: Mon, 12 Oct 2026 18:18:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E6=89=8B=E7=A4=BC=E5=8C=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- laf-cloud/functions/limitedTimeEvent.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/laf-cloud/functions/limitedTimeEvent.ts b/laf-cloud/functions/limitedTimeEvent.ts index 9b6dca7..f40cf66 100644 --- a/laf-cloud/functions/limitedTimeEvent.ts +++ b/laf-cloud/functions/limitedTimeEvent.ts @@ -166,11 +166,18 @@ export async function refreshStarterPack(user: any, trigger = false, collection register_time: user.register_time ?? null, levelAmount: user.levelAmount ?? null, ...(options?.reason === "low_coin" ? { coinAmount: user.coinAmount ?? null } : {}), - ...(options?.reason === 'low_health' ? { healthAmount: user.healthAmount ?? null, - userPowerTime: user.userPowerTime ?? null, healthtimestamp: user.healthtimestamp ?? null } : {}), - ...(options?.reason === 'low_props' ? { freezeAmount: user.freezeAmount ?? null, - hammerAmount: user.hammerAmount ?? null, magicAmount: user.magicAmount ?? null } : {}), - }).update(patch); + ...(options?.reason === 'low_health' ? { + healthAmount: user.healthAmount ?? null, + userPowerTime: user.userPowerTime ?? null, healthtimestamp: user.healthtimestamp ?? null + } : {}), + ...(options?.reason === 'low_props' ? { + freezeAmount: user.freezeAmount ?? null, + hammerAmount: user.hammerAmount ?? null, magicAmount: user.magicAmount ?? null + } : {}), + }).update({ + ...patch, + starterPackOffer: db.command.set(patch.starterPackOffer), + }); const fresh = await db.collection(collection).where({ _id: user._id }).getOne(); if (!fresh.data) throw new Error('未获取到玩家数据'); user = fresh.data;