Browse Source

update 一个圈圈

master
DengBiao 10 months ago
parent
commit
7920b3660f
2 changed files with 14 additions and 7 deletions
  1. +2
    -7
      rule/one_circles/one_circles_public_platoon_give_activty_coin.go
  2. +12
    -0
      rule/one_circles/one_circles_sign_in_green_energy_settlement.go

+ 2
- 7
rule/one_circles/one_circles_public_platoon_give_activty_coin.go View File

@@ -90,13 +90,8 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid
if err2 != nil {
return err2
}
//判断是否活跃
var m model.OneCirclesGreenEnergySignIn
has, err3 := engine.Where("uid =?", fatherUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m)
if err != nil {
return err3
}
if has && userCount >= zhios_order_relate_utils.StrToInt64(fatherReward.RewardCondition) {

if userCount >= zhios_order_relate_utils.StrToInt64(fatherReward.RewardCondition) {
fatherRewardValue := rewardValue * (zhios_order_relate_utils.StrToFloat64(fatherReward.RewardValue) / 100)
rewardFather = append(rewardFather, struct {
Uid int `json:"uid"` //用户id


+ 12
- 0
rule/one_circles/one_circles_sign_in_green_energy_settlement.go View File

@@ -100,6 +100,18 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string) (err erro
if parentRewardValue <= rewardEndValue {
break
}
//判断是否活跃
var m model.OneCirclesGreenEnergySignIn
has, err3333333 := engine.Where("uid =?", relate.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m)
if err3333333 != nil {
_ = session.Rollback()
fmt.Println("err:::::3333333", err3333333)
return err3333333
}
if !has {
//不活跃不需要奖励
continue
}
parentRewardValue = parentRewardValue * rewardDecrement
err = DealUserCoin(session, md.DealUserCoinReq{
Kind: "add",


Loading…
Cancel
Save