ソースを参照

update

master
dengbiao 3日前
コミット
7af1391a64
2個のファイルの変更36行の追加1行の削除
  1. +35
    -0
      consume/add_public_platoon_user_relation_commission.go
  2. +1
    -1
      go.mod

+ 35
- 0
consume/add_public_platoon_user_relation_commission.go ファイルの表示

@@ -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)


+ 1
- 1
go.mod ファイルの表示

@@ -8,7 +8,7 @@ go 1.19

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241214095356-fdac2df9537f
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241217150733-f7877f8f1d5c
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241219043645-3f6b3590ae75
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
github.com/boombuler/barcode v1.0.1


読み込み中…
キャンセル
保存