|
|
@@ -85,25 +85,31 @@ func handleAddPublicPlatoonUserRelationCommissionConsume(msgData []byte) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
if eggEnergyBasicSetting != nil { |
|
|
|
var newUserRewardRules *md2.NewUserRewardRules |
|
|
|
err = json.Unmarshal([]byte(eggEnergyBasicSetting.NewUserIncentiveRules), &newUserRewardRules) |
|
|
|
if err != nil { |
|
|
|
fmt.Println("handleAddPublicPlatoonUserRelationCommissionConsume___ERR>>>>", err.Error()) |
|
|
|
} |
|
|
|
rewardValue := newUserRewardRules.InviteUserRewardValue |
|
|
|
session := db.Db.NewSession() |
|
|
|
err = rule.DealUserVirtualCoin(session, md3.DealUserVirtualCoinReq{ |
|
|
|
Kind: "add", |
|
|
|
Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyRecruitNewUsersReward), |
|
|
|
TransferType: int(enum.EggEnergyRecruitNewUsersReward), |
|
|
|
CoinId: eggEnergyBasicSetting.PersonEggPointsCoinId, |
|
|
|
Uid: utils.StrToInt64(msg.RecommendUid), |
|
|
|
Amount: float64(rewardValue), |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
userDeleteInfoDb := implement.NewUserDeleteInfoDb(db.Db) |
|
|
|
fmt.Println("userDelete>>>>>>>>>>>>>>>", msg.Phone) |
|
|
|
userDelete := userDeleteInfoDb.GetUserDeleteInfo(msg.Phone) |
|
|
|
fmt.Println("userDelete>>>>>>>>>>>>>>>", userDelete) |
|
|
|
if userDelete == nil { |
|
|
|
var newUserRewardRules *md2.NewUserRewardRules |
|
|
|
err = json.Unmarshal([]byte(eggEnergyBasicSetting.NewUserIncentiveRules), &newUserRewardRules) |
|
|
|
if err != nil { |
|
|
|
fmt.Println("handleAddPublicPlatoonUserRelationCommissionConsume___ERR>>>>", err.Error()) |
|
|
|
} |
|
|
|
rewardValue := newUserRewardRules.InviteUserRewardValue |
|
|
|
session := db.Db.NewSession() |
|
|
|
err = rule.DealUserVirtualCoin(session, md3.DealUserVirtualCoinReq{ |
|
|
|
Kind: "add", |
|
|
|
Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyRecruitNewUsersReward), |
|
|
|
TransferType: int(enum.EggEnergyRecruitNewUsersReward), |
|
|
|
CoinId: eggEnergyBasicSetting.PersonEggPointsCoinId, |
|
|
|
Uid: utils.StrToInt64(msg.RecommendUid), |
|
|
|
Amount: float64(rewardValue), |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
session.Commit() |
|
|
|
} |
|
|
|
session.Commit() |
|
|
|
} |
|
|
|
return nil |
|
|
|
} |