fix: 更改fund的有效期为50天
This commit is contained in:
@@ -259,9 +259,9 @@ module.exports = {
|
||||
data: {
|
||||
list: newFund.fundList,
|
||||
basic: {
|
||||
activeFund,
|
||||
revenueLastday,
|
||||
revenueAll: newFund.asset['vic']
|
||||
activeFund, //有效矿晶
|
||||
revenueLastday, // 昨日收益
|
||||
revenueAll: newFund.asset['vic'] // 累计总收益
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,30 +14,13 @@ class Fund {
|
||||
this.blockNumber = blockNumber;
|
||||
this.blockHash = hash;
|
||||
const now = new Date();
|
||||
const exp = calExpirePeriod(amount);
|
||||
const exp = calExpirePeriod();
|
||||
this.createdAt = now.toISOString();
|
||||
this.expiresAt = new Date(now.getTime() + exp * DayLong);
|
||||
this.releasedAmout = 0;
|
||||
}
|
||||
}
|
||||
const calExpirePeriod = amount => {
|
||||
switch (true) {
|
||||
case (amount >= 200 && amount <= 1999):
|
||||
return 300;
|
||||
case amount >= 2000 && amount <= 3999:
|
||||
return 310;
|
||||
case amount >=4000 && amount <=5999:
|
||||
return 320;
|
||||
case amount >= 6000 && amount <= 7999:
|
||||
return 330;
|
||||
case amount >= 8000 && amount <= 9999:
|
||||
return 340;
|
||||
case amount >= 10000 && amount <= 11999:
|
||||
return 350;
|
||||
case amount >= 12000:
|
||||
return 365;
|
||||
default: return 0;
|
||||
}
|
||||
};
|
||||
const calExpirePeriod = () => 50;
|
||||
|
||||
module.exports = {
|
||||
createNewFund (txData) {
|
||||
@@ -53,6 +36,7 @@ module.exports = {
|
||||
return revenueLastday;
|
||||
},
|
||||
getActiveFund (fundList) {
|
||||
// fund里面的项目,status=1的就是正在挖的有效矿晶
|
||||
let activeFund = 0;
|
||||
for (let i = fundList.length; i >= 0; i--) {
|
||||
const fundItem = fundList[i];
|
||||
|
||||
@@ -31,7 +31,9 @@ const FundSchema = new mongoose.Schema({
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
// asset表示用户的财产,包括VIC/团队奖励的USDT
|
||||
// asset表示用户的收益,包括VIC和团队奖励的USDT
|
||||
// vic是挖矿得到的奖励
|
||||
// usdt是社群奖励,后面加上了糖果,也代表糖果数量
|
||||
asset: {
|
||||
type: {},
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user