后台:礼包码区分渠道
This commit is contained in:
@@ -149,6 +149,7 @@ export class ItemHandler {
|
||||
const roleName: string = session.get('roleName');
|
||||
const serverId: number = session.get('serverId');
|
||||
const sid: string = session.get('sid');
|
||||
const channel: string = session.get('channel');
|
||||
const { code } = msg;
|
||||
|
||||
let giftCodeDetail = await GiftCodeDetailModel.findByCode(code);
|
||||
@@ -166,6 +167,10 @@ export class ItemHandler {
|
||||
if (giftCode.beginTime > nowSeconds()) return resResult(STATUS.GIFT_CODE_NOT_START);
|
||||
if (giftCode.endTime < nowSeconds()) return resResult(STATUS.GIFT_CODE_HAS_EXPIRED);
|
||||
|
||||
if(giftCode.channel.indexOf('all') == -1 && giftCode.channel.indexOf(channel) == -1) {
|
||||
return resResult(STATUS.GIFT_CODE_CHANNEL_ERR);
|
||||
}
|
||||
|
||||
if (giftCodeDetail.roleIds.indexOf(roleId) != -1) {
|
||||
return resResult(STATUS.YOU_HAVE_USED_THIS_CODE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user