|
|
@@ -6,7 +6,10 @@ import ( |
|
|
|
"applet/app/utils" |
|
|
|
"applet/app/utils/logx" |
|
|
|
"applet/consume/md" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" |
|
|
|
"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" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_system_rules.git/rule" |
|
|
|
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" |
|
|
@@ -63,6 +66,38 @@ func handleAddPublicPlatoonUserRelationCommissionConsume(msgData []byte) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
//2、给到直推奖励 |
|
|
|
eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(db.Db) |
|
|
|
eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{ |
|
|
|
"key": "is_open", |
|
|
|
"value": 1, |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
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 |
|
|
|
} |
|
|
|
session.Commit() |
|
|
|
} |
|
|
|
|
|
|
|
//3、加入公排 |
|
|
|
var req []*md2.AddPublicPlatoonUserRelationCommissionReq |
|
|
|
req = append(req, msg) |
|
|
|
_, err = rule.AddPublicPlatoonUserRelationCommission(db.Db, req) |
|
|
|