feat: mongodb配置更新;在充值action里记录区块链数值,在fundList里乘汇率
This commit is contained in:
@@ -25,7 +25,8 @@ module.exports = inject(async function connect2db(SysConfig) {
|
|||||||
useNewUrlParser: true,
|
useNewUrlParser: true,
|
||||||
bufferMaxEntries: 0,
|
bufferMaxEntries: 0,
|
||||||
autoReconnect: true,
|
autoReconnect: true,
|
||||||
useFindAndModify: false
|
useFindAndModify: false,
|
||||||
|
useUnifiedTopology: true
|
||||||
});
|
});
|
||||||
return db;
|
return db;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -95,15 +95,15 @@ FundModel.prototype.addFund = async function (txlist = [], option) {
|
|||||||
const actionPromiseList = [];
|
const actionPromiseList = [];
|
||||||
const newFundList = txlist.map(txObj => {
|
const newFundList = txlist.map(txObj => {
|
||||||
const depositAmount = +txObj.amount * USDT2VIC_RATE;
|
const depositAmount = +txObj.amount * USDT2VIC_RATE;
|
||||||
txObj.amount = depositAmount; // 把区块链的数值乘以比率 !!!!
|
|
||||||
newSum += depositAmount;
|
newSum += depositAmount;
|
||||||
const action = createAction(0, {
|
const action = createAction(0, {
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
amount: depositAmount,
|
amount: +txObj.amount, // 充值记录的数值仍然是区块链的数值
|
||||||
tokenType: 'vic', // 目前设定只能挖出矿晶vic
|
tokenType: 'vic', // 目前设定只能挖出矿晶vic
|
||||||
remain: this.asset
|
remain: this.asset
|
||||||
});
|
});
|
||||||
actionPromiseList.push(action.save());
|
actionPromiseList.push(action.save());
|
||||||
|
txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率 !!!!
|
||||||
return createNewFund(txObj);
|
return createNewFund(txObj);
|
||||||
});
|
});
|
||||||
// 1.注入资金
|
// 1.注入资金
|
||||||
|
|||||||
Reference in New Issue
Block a user