import cloud from '@lafjs/cloud' const db=cloud.database(); import Utils from "@/Utils"; export default async function (ctx: FunctionContext) { let db1 = "691093093cf0c4532ba4fd9c"; const uid=ctx.body.uid; const gameName = ctx.body.gameName; if (gameName == "iaa") { db1 = "691097ac3cf0c4532ba4fd9e"; } let rankInfo = await db.collection("sRank").where({ _id: db1 }).getOne(); let total = JSON.parse(rankInfo.data.total); for(var key in total){ for(let i=0;i