Browse Source

update

master
dengbiao 3 days ago
parent
commit
f4c462be9b
2 changed files with 26 additions and 2 deletions
  1. +3
    -0
      enum/user_wallet_fllow.go
  2. +23
    -2
      rule/egg_energy/give_activty_coin.go

+ 3
- 0
enum/user_wallet_fllow.go View File

@@ -12,6 +12,7 @@ const (
UserReceiveRedPackage
UserWithdrawApply
UserWithdrawBad
UserToAlipayRealName
)

func (kind UserWalletFlowTransferType) String() string {
@@ -32,6 +33,8 @@ func (kind UserWalletFlowTransferType) String() string {
return "用户提现"
case UserWithdrawBad:
return "提现失败"
case UserToAlipayRealName:
return "支付宝实名认证"
default:
return "未知状态"
}


+ 23
- 2
rule/egg_energy/give_activty_coin.go View File

@@ -373,8 +373,29 @@ func dealEcpm(user model.User, ecpm string, ch *rabbit.Channel) {
}
}
func ActivityCoinToAlipayRealName(engine *xorm.Engine, uid int64, amount string) (err error) {
amountValue, _ := decimal.NewFromString(amount)
session := engine.NewSession()
defer func() {
session.Close()
if err := recover(); err != nil {
_ = zhios_order_relate_logx.Error(err)
}
}()
session.Begin()

err = rule.DealUserWallet(session, md.DealUserWalletReq{
Direction: "sub",
Kind: int(enum.UserToAlipayRealName),
Title: enum.UserToAlipayRealName.String(),
Uid: uid,
Amount: egg_system_rules.StrToFloat64(amount),
})
if err != nil {
session.Rollback()
return err
}
return session.Commit()

amountValue, _ := decimal.NewFromString(amount)
//1、查找 `egg_energy_basic_setting` 基础设置
eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine)
eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{
@@ -412,7 +433,7 @@ func ActivityCoinToAlipayRealName(engine *xorm.Engine, uid int64, amount string)
}

//3、扣除对应个人蛋蛋积分
session := engine.NewSession()
session = engine.NewSession()
defer func() {
session.Close()
if err := recover(); err != nil {


Loading…
Cancel
Save