|
@@ -41,10 +41,11 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string) (err erro |
|
|
fmt.Println("rewardEndValue>>>>>>>>>>>>", rewardEndValue) |
|
|
fmt.Println("rewardEndValue>>>>>>>>>>>>", rewardEndValue) |
|
|
|
|
|
|
|
|
//2、获取当前签到收益 |
|
|
//2、获取当前签到收益 |
|
|
err, rewardValue := CalcNowSignInGreenEnergy(engine, oneCirclesGreenEnergyBasicSetting) |
|
|
|
|
|
|
|
|
err, reward := CalcNowSignInGreenEnergy(engine, oneCirclesGreenEnergyBasicSetting) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
|
|
|
rewardValue := zhios_order_relate_utils.Float64ToStrPrec8(zhios_order_relate_utils.StrToFloat64(reward) * float64(oneRoundDuration) * 60 * 60) |
|
|
|
|
|
|
|
|
//3、统计签到结束的用户数据 |
|
|
//3、统计签到结束的用户数据 |
|
|
now := time.Now() |
|
|
now := time.Now() |
|
@@ -136,12 +137,6 @@ func CalcNowSignInGreenEnergy(engine *xorm.Engine, oneCirclesGreenEnergyBasicSet |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var teamRewardSetting *md2.TeamRewardSettingStruct |
|
|
|
|
|
err = json.Unmarshal([]byte(oneCirclesGreenEnergyBasicSetting.VipEquitySetting), &teamRewardSetting) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
var oneRoundDuration = zhios_order_relate_utils.StrToInt(teamRewardSetting.OneRoundDuration) |
|
|
|
|
|
|
|
|
|
|
|
var signInRewards []*md2.SignInRewardStruct |
|
|
var signInRewards []*md2.SignInRewardStruct |
|
|
err = json.Unmarshal([]byte(oneCirclesGreenEnergyBasicSetting.VipEquitySetting), &signInRewards) |
|
|
err = json.Unmarshal([]byte(oneCirclesGreenEnergyBasicSetting.VipEquitySetting), &signInRewards) |
|
@@ -160,7 +155,8 @@ func CalcNowSignInGreenEnergy(engine *xorm.Engine, oneCirclesGreenEnergyBasicSet |
|
|
|
|
|
|
|
|
for _, v := range signInRewards { |
|
|
for _, v := range signInRewards { |
|
|
if zhios_order_relate_utils.StrToInt64(v.VipMemberEndNums) <= userCount && userCount <= zhios_order_relate_utils.StrToInt64(v.VipMemberStartNums) { |
|
|
if zhios_order_relate_utils.StrToInt64(v.VipMemberEndNums) <= userCount && userCount <= zhios_order_relate_utils.StrToInt64(v.VipMemberStartNums) { |
|
|
rewardValue = zhios_order_relate_utils.Float64ToStrPrec8(zhios_order_relate_utils.StrToFloat64(v.RewardValue) * float64(oneRoundDuration) * 60 * 60) |
|
|
|
|
|
|
|
|
//rewardValue = zhios_order_relate_utils.Float64ToStrPrec8(zhios_order_relate_utils.StrToFloat64(v.RewardValue) * float64(oneRoundDuration) * 60 * 60) |
|
|
|
|
|
rewardValue = v.RewardValue |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return |
|
|
return |
|
|