活动:元宝充值商店
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { Application, BackendSession } from 'pinus';
|
||||
import { genCode, resResult } from '../../../pubUtils/util';
|
||||
import { ACTIVITY_TYPE, ORDER_STATE, PAY_TYPE, STATUS } from '../../../consts';
|
||||
import { RoleModel } from '../../../db/Role';
|
||||
import { addReward, stringToRewardParam, useGiftPackage } from '../../../services/giftPackageService';
|
||||
import { dicRMB } from '../../../pubUtils/dictionary/DicRMB';
|
||||
import { UserOrderModel } from '../../../db/UserOrder';
|
||||
import _ = require('underscore');
|
||||
@@ -22,15 +20,16 @@ export class orderHandler {
|
||||
|
||||
/**
|
||||
* @description 获取订单号
|
||||
* @param {{productID:string, payType:number }} msg
|
||||
* @param {{productID:string, payType:number ,activityId: number }} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof orderHandler
|
||||
*/
|
||||
async applyOrder(msg: { productID: string, payType: number }, session: BackendSession) {
|
||||
const { productID, payType } = msg;
|
||||
async applyOrder(msg: { productID: string, payType: number, activityId: number }, session: BackendSession) {
|
||||
const { productID, payType, activityId } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const serverId = session.get('serverId');
|
||||
|
||||
//如果有特殊情况,activityId可为0
|
||||
if (!productID || !_.isString(productID) || !payType || !_.isNumber(payType)) {
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
}
|
||||
@@ -80,7 +79,7 @@ export class orderHandler {
|
||||
console.log('未知支付类型');
|
||||
return resResult(STATUS.NO_PAY_TYPE);
|
||||
}
|
||||
await UserOrderModel.applyOrder(serverId, roleId, productID, localOrderID, orderID, price, payType);
|
||||
await UserOrderModel.applyOrder(serverId, roleId, productID, localOrderID, orderID, price, payType, activityId);
|
||||
return resResult(STATUS.SUCCESS, { orderInfo: sdkOrderInfo, productInfo, localOrderID });
|
||||
}
|
||||
|
||||
@@ -174,7 +173,7 @@ export class orderHandler {
|
||||
orderInfo = await UserOrderModel.success(roleId, localOrderID);
|
||||
if (orderInfo) {
|
||||
//结算奖励
|
||||
let result = await makeOrder(localOrderID);
|
||||
let result = await makeOrder(localOrderID, sid);
|
||||
console.log('结算完成', localOrderID)
|
||||
return resResult(STATUS.SUCCESS, result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user