fix(学宫): 修复图鉴统计数量

This commit is contained in:
luying
2023-10-08 19:38:01 +08:00
parent 3ebedcb967
commit 144181f2e1

View File

@@ -186,10 +186,10 @@ export function formateCharasOrCards(params: RougelikeCharaPara[] | RougelikeCar
export async function addCollection(roleId: string, sid: string, gameCode: string, arr: { type: number, id: number, addNum?: number }[]) {
let collections: { type: number, id: number, num: number }[] = [], passiveCnt = 0;
for (let { type, id, addNum = 1 } of arr) {
if (type == COLLECTION_TYPE.PASSIVE_CARD_SUM) continue;
if (type == COLLECTION_TYPE.PASSIVE_CARD_SUM || id == 0) continue;
let collection = await RougelikeCollectionModel.addRec(roleId, type, id, gameCode, addNum);
if (!collection || collection.num > 1) continue;
if (collection.num == 1) passiveCnt++;
if (type == COLLECTION_TYPE.PASSIVE_CARD && collection.num == 1) passiveCnt++;
collections.push({ type, id, num: collection.num });
}
if (passiveCnt > 0) {