|
|
@@ -1,6 +1,7 @@ |
|
|
|
package one_circles |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/db" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/db/model" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md" |
|
|
@@ -17,7 +18,7 @@ import ( |
|
|
|
) |
|
|
|
|
|
|
|
// SettlementPublicGiveActivityCoin 计算观看激励视屏得到活跃积分 |
|
|
|
func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid int) (err error) { |
|
|
|
func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid int, ch *rabbit.Channel) (err error) { |
|
|
|
//1、查找 `one_circles_public_platoon_basic_setting` 基础设置 |
|
|
|
oneCirclesPublicPlatoonBasicSetting, err := db.OneCirclesPublicPlatoonBasicSettingGetOneByParams(engine, map[string]interface{}{ |
|
|
|
"key": "is_open", |
|
|
@@ -182,7 +183,8 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid |
|
|
|
|
|
|
|
//给相应的用户加上"团队"活跃积分 |
|
|
|
for _, vv := range rewardFather { |
|
|
|
err = DealUserCoin(session, md.DealUserCoinReq{ |
|
|
|
//TODO::推入rabbitmq 异步处理 |
|
|
|
ch.Publish(md.OneCirclesExchange, md.DealUserCoinReq{ |
|
|
|
Kind: "add", |
|
|
|
Mid: masterId, |
|
|
|
Title: md.OneCirclesWatchAdRewardTeamActiveCoin, |
|
|
@@ -191,12 +193,23 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid |
|
|
|
CoinId: oneCirclesPublicPlatoonBasicSetting.TeamActivePointsCoinId, |
|
|
|
Uid: vv.Uid, |
|
|
|
Amount: vv.RewardValue, |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
_ = session.Rollback() |
|
|
|
fmt.Println("err:::::2222", err) |
|
|
|
return err |
|
|
|
} |
|
|
|
}, md.OneCirclesRoutKeyForSettlementPublicGiveActivityCoin) |
|
|
|
|
|
|
|
//err = DealUserCoin(session, md.DealUserCoinReq{ |
|
|
|
// Kind: "add", |
|
|
|
// Mid: masterId, |
|
|
|
// Title: md.OneCirclesWatchAdRewardTeamActiveCoin, |
|
|
|
// TransferType: md.OneCirclesWatchAdRewardTeamActiveCoinForUserVirtualCoinFlow, |
|
|
|
// OrdId: "", |
|
|
|
// CoinId: oneCirclesPublicPlatoonBasicSetting.TeamActivePointsCoinId, |
|
|
|
// Uid: vv.Uid, |
|
|
|
// Amount: vv.RewardValue, |
|
|
|
//}) |
|
|
|
//if err != nil { |
|
|
|
// _ = session.Rollback() |
|
|
|
// fmt.Println("err:::::2222", err) |
|
|
|
// return err |
|
|
|
//} |
|
|
|
} |
|
|
|
err = session.Commit() |
|
|
|
if err != nil { |
|
|
|