feat(充值): 添加英杰币

This commit is contained in:
luying
2023-04-11 11:33:10 +08:00
parent 10d0e13bcc
commit 86c5d08642
7 changed files with 62 additions and 11 deletions

View File

@@ -33,6 +33,7 @@ import { checkParamPrice, needRebate } from '../pubUtils/sdkUtil';
import { checkShopCanBuyInOrder, makeShopOrder } from './shopService';
import { checkWeeklyFund, makeWeeklyFund } from './activity/weeklyFundService';
import { checkMonthlyFund, makeMonthlyFund } from './activity/monthlyFundService';
import { gameData } from '../pubUtils/data';
export async function checkOrderCanBuy(roleId: string, serverId: number, activityData: ActivityModelType, productID: string, paramStr: string) {
let activityId = activityData.activityId;
@@ -270,7 +271,7 @@ export async function settleOrder(order: UserOrderModelType, serverId: number, s
//成长任务
checkTask(serverId, order.roleId, null, TASK_TYPE.ACTIVITY_RMB, { count: order.price });
if(order.payType != PAY_TYPE.TEST) {
reportTAEvent(order.roleId, TA_EVENT.RECHARGE_SUCCESS, { pay_id: order.localOrderID, charge_id: order.productID, pay_name: order.message, pay_amount: order.price, pay_channel: order.payType, pay_type: order.useVoucher? "现金": "代金券" })
reportTAEvent(order.roleId, TA_EVENT.RECHARGE_SUCCESS, { pay_id: order.localOrderID, charge_id: order.productID, pay_name: order.message, pay_amount: order.price, pay_channel: order.payType, pay_type: getVoucherType(order.useVoucher, order.voucherId) })
reportTAUserSet(TA_USERSET_TYPE.SET_ONCE, order.roleId, { first_pay_time: new Date() });
reportTAUserSet(TA_USERSET_TYPE.SET, order.roleId, { last_pay_time: new Date() });
reportTAUserSet(TA_USERSET_TYPE.ADD, order.roleId, { total_revenue: order.price });
@@ -286,6 +287,15 @@ export async function settleOrder(order: UserOrderModelType, serverId: number, s
return result.data;
}
function getVoucherType(useVoucher: boolean, voucherId: number) {
if(useVoucher) {
let dicGood = gameData.goods.get(voucherId);
if(!dicGood) return '未知';
return dicGood.name;
}
return '现金'
}
export async function settleOrderWx(order: UserOrderModelType, serverId: number, sid: string) {
if (order.state == ORDER_STATE.RESULT_SUCCESS) {