feat:addFund充值时自动乘以汇率

This commit is contained in:
chaosBreaking
2019-09-28 11:50:38 +08:00
parent 04dcf78cdb
commit 12021334ab
2 changed files with 4 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ const { createAction } = require('../action/action.handler');
const { createNewFund } = require('./fund.handler');
const { getNewDepositTx, getUSDTTxList } = require('../../common/deposit');
const USDT2VIC_RATE = 100;
const FundSchema = new mongoose.Schema({
userId: {
type: String
@@ -95,7 +97,7 @@ FundModel.prototype.addFund = async function (txlist = [], option) {
newSum += +txObj.amount;
const action = createAction(0, {
userId: this.userId,
amount: txObj.amount,
amount: +txObj.amount * USDT2VIC_RATE,
tokenType: 'vic', // 目前设定只能挖出矿晶vic
remain: this.asset
});