支付:代金券功能

This commit is contained in:
luying
2022-07-11 18:07:56 +08:00
parent b9af56fd07
commit ae369f7bf2
14 changed files with 179 additions and 93 deletions

View File

@@ -34,6 +34,8 @@ export default class UserOrder extends BaseModel {
activityId: number; // 活动ID
@prop({ required: true })
paramStr: string; // 订单参数
@prop({ required: true })
useVoucher: boolean; // 使用代金券
//保存平台订单号
@@ -122,9 +124,9 @@ export default class UserOrder extends BaseModel {
//新增订单
public static async applyOrder(serverId: number, roleId: string, productID: string, localOrderID: string, orderID: string, price: number, payType: number, activityId: number, paramStr: string, message: string) {
public static async applyOrder(serverId: number, roleId: string, productID: string, localOrderID: string, orderID: string, price: number, payType: number, activityId: number, paramStr: string, message: string, useVoucher: boolean) {
let result: UserOrderModelType = await UserOrderModel.findOneAndUpdate({ serverId, roleId, productID, localOrderID, orderID, payType, activityId },
{ $set: { price, state: ORDER_STATE.APPLY, message, paramStr: paramStr ? paramStr : '' } },
{ $set: { price, state: ORDER_STATE.APPLY, message, paramStr: paramStr ? paramStr : '', useVoucher } },
{ upsert: true, new: true }).lean(true);
return result;
}