🐞 fix(订单): 使用代金券限制
This commit is contained in:
@@ -173,6 +173,15 @@ export class orderHandler {
|
||||
if(orderInfo.useVoucher) {
|
||||
let voucherId = orderInfo.voucherId;
|
||||
let voucher = [{ id: voucherId, count: productInfo.price }];
|
||||
|
||||
if(orderInfo.state != ORDER_STATE.APPLY) {
|
||||
return resResult(STATUS.DUPLICATE_ORDER);
|
||||
}
|
||||
if(orderInfo.roleId != roleId) {
|
||||
console.log('订单玩家错误');
|
||||
return resResult(STATUS.ORDER_STATUS_ERROR);
|
||||
}
|
||||
|
||||
let result = await handleCost(roleId, sid, voucher, ITEM_CHANGE_REASON.USE_VOUCHER);
|
||||
if(!result) return resResult(STATUS.VOUCHER_NOT_ENOUGH);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user