Merge branch 'bugfix' into dev

This commit is contained in:
xichaoyin 2024-01-04 22:25:31 +08:00
commit 98e34a065b

View File

@ -27,11 +27,12 @@ export default async function (call: ApiCall<ReqReceive, ResReceive>) {
if (!payLog || !payLog.length) continue; if (!payLog || !payLog.length) continue;
for (let key of ["prize", "recPrize1", "recPrize2"]) { for (let key of ["prize", "recPrize1", "recPrize2"]) {
if (data.record[gift.id] && data.record[gift.id].includes(key)) { if (!data || !data?.record[gift.id] || !data.record[gift.id].includes(key)) {
push.concat(key); push.push(key);
prize.concat(gift[key]); prize.push(...gift[key]);
} }
} }
if (push.length > 0) { if (push.length > 0) {
if (update["$push"]) { if (update["$push"]) {
update["$push"]["record." + gift.id] = { $each: push } update["$push"]["record." + gift.id] = { $each: push }