|
@@ -144,6 +144,19 @@ func HomePage(c *gin.Context) { |
|
|
|
|
|
|
|
|
// 6、预估能量 + 原有能量 |
|
|
// 6、预估能量 + 原有能量 |
|
|
totalEggEnergyDecimal := decimal.NewFromFloat(totalEggEnergy).Add(estimatePersonEggEnergyValue).Add(estimateTeamEggEnergyValue) |
|
|
totalEggEnergyDecimal := decimal.NewFromFloat(totalEggEnergy).Add(estimatePersonEggEnergyValue).Add(estimateTeamEggEnergyValue) |
|
|
|
|
|
// 7、总能量预估价值 |
|
|
|
|
|
coreDataDb := implement.NewEggEnergyCoreDataDb(db.Db) |
|
|
|
|
|
coreData, err := coreDataDb.EggEnergyCoreDataGet() |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
nowPriceDecimal, err := decimal.NewFromString(coreData.NowPrice) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR, err.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
totalEggEnergyValueDecimal := totalEggEnergyDecimal.Mul(nowPriceDecimal) |
|
|
|
|
|
|
|
|
utils.FilePutContents("HomePage", utils.SerializeStr(map[string]interface{}{ |
|
|
utils.FilePutContents("HomePage", utils.SerializeStr(map[string]interface{}{ |
|
|
"user_phone": user.Phone, |
|
|
"user_phone": user.Phone, |
|
@@ -167,15 +180,16 @@ func HomePage(c *gin.Context) { |
|
|
})) |
|
|
})) |
|
|
|
|
|
|
|
|
resp := md.HomePageResp{ |
|
|
resp := md.HomePageResp{ |
|
|
LeaveTimer: utils.Int64ToStr(residueTimes), |
|
|
|
|
|
IsSign: isSign, |
|
|
|
|
|
SignEndTime: signCountdown, |
|
|
|
|
|
TotalEggEnergy: totalEggEnergyDecimal.String(), |
|
|
|
|
|
TotalActivePoints: utils.Float64ToStr(totalActivePoints), |
|
|
|
|
|
InitialPrice: initialPrice, |
|
|
|
|
|
NowBasalRate: utils.Float64ToStr(nowBasalRate), |
|
|
|
|
|
NowTeamRate: utils.Float64ToStr(NowTeamRate), |
|
|
|
|
|
NickName: user.Nickname, |
|
|
|
|
|
|
|
|
LeaveTimer: utils.Int64ToStr(residueTimes), |
|
|
|
|
|
IsSign: isSign, |
|
|
|
|
|
SignEndTime: signCountdown, |
|
|
|
|
|
TotalEggEnergy: totalEggEnergyDecimal.String(), |
|
|
|
|
|
TotalEggEnergyValue: totalEggEnergyValueDecimal.String(), |
|
|
|
|
|
TotalActivePoints: utils.Float64ToStr(totalActivePoints), |
|
|
|
|
|
InitialPrice: initialPrice, |
|
|
|
|
|
NowBasalRate: utils.Float64ToStr(nowBasalRate), |
|
|
|
|
|
NowTeamRate: utils.Float64ToStr(NowTeamRate), |
|
|
|
|
|
NickName: user.Nickname, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
e.OutSuc(c, resp, nil) |
|
|
e.OutSuc(c, resp, nil) |
|
|