Преглед изворни кода

update 一个圈圈

master
DengBiao пре 11 месеци
родитељ
комит
1ade9a13bc
1 измењених фајлова са 28 додато и 28 уклоњено
  1. +28
    -28
      rule/one_circles/one_circles_auto_release_green_energy.go

+ 28
- 28
rule/one_circles/one_circles_auto_release_green_energy.go Прегледај датотеку

@@ -39,41 +39,41 @@ func AutoReleaseExchangeGreenEnergy(engine *xorm.Engine, masterId string) (err e
}

session := engine.NewSession()

//4、处理释放
settlementQuantityRadio := decimal.NewFromFloat(100)
settlementQuantityValue := decimal.NewFromInt(int64(settlementQuantity)).Div(settlementQuantityRadio)
for _, v := range list1 {
userAmount, _ := decimal.NewFromString(v.Amount)
settlementQuantityAmount, _ := userAmount.Mul(settlementQuantityValue).Float64()
if settlementQuantityAmount > 0 {
//4.2给相应的用户加上个人的绿色积分(可用数量)
err = DealUserCoin(session, md.DealUserCoinReq{
Kind: "add",
Mid: masterId,
Title: md.OneCirclesSettlementGreenEnergyExchangeGreenEnergy,
TransferType: md.OneCirclesSettlementGreenEnergyExchangeGreenEnergyForUserVirtualCoinFlow,
OrdId: "",
CoinId: oneCirclesGreenEnergyBasicSetting.PersonGreenEnergyCoinId,
Uid: v.Uid,
Amount: settlementQuantityAmount,
})

//4.2给相应的用户加上个人的绿色积分(可用数量)
err = DealUserCoin(session, md.DealUserCoinReq{
Kind: "add",
Mid: masterId,
Title: md.OneCirclesSettlementGreenEnergyExchangeGreenEnergy,
TransferType: md.OneCirclesSettlementGreenEnergyExchangeGreenEnergyForUserVirtualCoinFlow,
OrdId: "",
CoinId: oneCirclesGreenEnergyBasicSetting.PersonGreenEnergyCoinId,
Uid: v.Uid,
Amount: settlementQuantityAmount,
})

//4.2给相应的用户减少个人的绿色积分(结算数量)
err = DealUserCoin(session, md.DealUserCoinReq{
Kind: "sub",
Mid: masterId,
Title: md.OneCirclesSettlementGreenEnergyExchangeTobeGreenEnergy,
TransferType: md.OneCirclesSettlementGreenEnergyExchangeTobeGreenEnergyForUserVirtualCoinFlow,
OrdId: "",
CoinId: oneCirclesGreenEnergyBasicSetting.TeamGreenEnergyCoinId,
Uid: v.Uid,
Amount: settlementQuantityAmount,
})
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::33333", err)
return err
//4.2给相应的用户减少个人的绿色积分(结算数量)
err = DealUserCoin(session, md.DealUserCoinReq{
Kind: "sub",
Mid: masterId,
Title: md.OneCirclesSettlementGreenEnergyExchangeTobeGreenEnergy,
TransferType: md.OneCirclesSettlementGreenEnergyExchangeTobeGreenEnergyForUserVirtualCoinFlow,
OrdId: "",
CoinId: oneCirclesGreenEnergyBasicSetting.TeamGreenEnergyCoinId,
Uid: v.Uid,
Amount: settlementQuantityAmount,
})
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::33333", err)
return err
}
}
}



Loading…
Откажи
Сачувај