后台添加添加元宝功能

This commit is contained in:
luying
2020-11-10 19:47:10 +08:00
parent 5a700b87c7
commit 58f0eef142
2 changed files with 17 additions and 2 deletions
+12
View File
@@ -290,6 +290,18 @@ export default class GMUsers extends Service {
}
}
public async addGold(uids: Array<string>, _count: string) {
const {ctx} = this;
console.log('gm addGold', uids, _count);
let count = parseInt(_count);
if(isNaN(count)) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
for(let roleId of uids) {
await RoleModel.addGoldFree(roleId, count);
}
return ctx.service.utils.resResult(STATUS.SUCCESS, { uids });
}
public async getPvpDefense(roleId: string) {
const {ctx} = this;
let result = await PvpDefenseModel.findByRoleId(roleId);