浏览代码

1

withdrawal
dengbiao 3 天前
父节点
当前提交
cc3907c6c9
共有 1 个文件被更改,包括 20 次插入6 次删除
  1. +20
    -6
      consume/egg_energy_recruit_new_user_reward.go

+ 20
- 6
consume/egg_energy_recruit_new_user_reward.go 查看文件

@@ -8,6 +8,7 @@ import (
"applet/app/utils/logx"
"applet/consume/md"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"code.fnuoos.com/EggPlanet/egg_system_rules.git"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
md3 "code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
@@ -18,6 +19,8 @@ import (
"errors"
"fmt"
"github.com/streadway/amqp"
"strconv"
"time"
)

func EggEnergyRecruitNewUserRewardConsume(queue md.MqQueue) {
@@ -92,13 +95,24 @@ func handleEggEnergyRecruitNewUserRewardConsume(msgData []byte) error {
fmt.Println("userDelete>>>>>>>>>>>>>>>", userDelete)
if userDelete == nil {
var newUserRewardRules *md2.NewUserRewardRules
err1 = json.Unmarshal([]byte(eggEnergyBasicSetting.NewUserIncentiveRules), &newUserRewardRules)
if err1 != nil {
fmt.Println("handleAddPublicPlatoonUserRelationCommissionConsume___ERR>>>>", err1.Error())
err2 := json.Unmarshal([]byte(eggEnergyBasicSetting.NewUserIncentiveRules), &newUserRewardRules)
if err2 != nil {
fmt.Println("handleEggEnergyRecruitNewUserRewardConsume___ERR>>>>", err2.Error())
}
rewardValue := newUserRewardRules.InviteUserRewardValue
_, err2 = eggEnergyRecruitNewUserRewardDb.EggEnergyRecruitNewUserRewardInsert(&model.EggEnergyRecruitNewUserReward{
Uid: user.Id,
RecommendUid: user.ParentUid,
Value: strconv.Itoa(rewardValue),
CreateAt: time.Now().Format("2006-01-02 15:04:05"),
UpdateAt: time.Now().Format("2006-01-02 15:04:05"),
})
if err2 != nil {
return err2
}

session := db.Db.NewSession()
err1 = rule.DealUserVirtualCoin(session, md3.DealUserVirtualCoinReq{
err2 = rule.DealUserVirtualCoin(session, md3.DealUserVirtualCoinReq{
Kind: "add",
Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyRecruitNewUsersReward),
TransferType: int(enum.EggEnergyRecruitNewUsersReward),
@@ -106,8 +120,8 @@ func handleEggEnergyRecruitNewUserRewardConsume(msgData []byte) error {
Uid: user.ParentUid,
Amount: float64(rewardValue),
})
if err1 != nil {
return err1
if err2 != nil {
return err2
}
session.Commit()
}


正在加载...
取消
保存