商店:不需要后台了,删除一部分后台相关的

This commit is contained in:
luying
2021-09-16 19:25:47 +08:00
parent fd6d2ac2e3
commit 063d46e4db
3 changed files with 14 additions and 60 deletions

View File

@@ -62,16 +62,6 @@ export class ShopHandler {
if(!hero) return resResult(STATUS.SKIN_HAS_NOT_HERO);
}
let dbShop = await DicShopListModel.findByShopId(dicShopItem.shop);
let discount = 1;
if(dbShop) {
let item = dbShop.items.find(cur => cur.id == shopItemId);
if(item) {
discount = item.discount;
}
}
let userShop = await UserShopModel.findByRoleAndItem(roleId, dicShopItem.id);
if(dicShopItem.purchaseLimit != -1) {
if(userShop && userShop.count + count > dicShopItem.purchaseLimit) {
@@ -82,7 +72,7 @@ export class ShopHandler {
// 消耗
let cost = [{
id: dicShopItem.money,
count: Math.round(dicShopItem.price * count * discount)
count: Math.round(dicShopItem.price * count)
}];
let costResult = await handleCost(roleId, sid, cost);
if(!costResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
@@ -151,14 +141,6 @@ export class ShopHandler {
});
}
// !测试接口初始化将json表中的内容加入数据库内
async initShopList() {
let index = gameData.shopItem.size;
for(let [id, dic] of gameData.shopItem) {
await DicShopListModel.createShop(dic.shop, true, { id, order: index--, discount: 1 })
}
}
// !测试接口。 去除限购次数
async debugClearPurchaseLimit(msg: { }, session: BackendSession) {
let roleId = session.get('roleId');