充值:添加充值前检查
This commit is contained in:
@@ -163,4 +163,27 @@ export async function makePopUpShopReward(roleId: string, roleName: string, sid:
|
||||
code: 0,
|
||||
data: Object.assign(result, { item: item, activityId })
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkPopUpShopCanBuy(roleId: string, serverId: number, activityId: number, productID: string, paramStr: string) {
|
||||
if (!paramStr) {
|
||||
return false;
|
||||
}
|
||||
let paramObj = JSON.parse(paramStr);
|
||||
let code = paramObj.code;
|
||||
|
||||
let playerData = await getPopUpShopData(activityId, serverId, roleId);
|
||||
if (!playerData) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let playerRecord: ActivityPopUpShopModelType = await ActivityPopUpShopModel.findByCode(serverId, activityId, roleId, code);
|
||||
if (!playerRecord) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let item = playerData.checkItem(playerRecord, productID);
|
||||
if(!item) return false;
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user