支付:代金券功能
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user