|
|
@@ -31,6 +31,16 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin |
|
|
|
uid := user.Id |
|
|
|
now := time.Now() |
|
|
|
|
|
|
|
//TODO::拒绝重复异常回调 |
|
|
|
redisKey := fmt.Sprintf(md2.UserNextWatchAdDate, uid) |
|
|
|
nextWatchAdDate, _ := cache.GetString(redisKey) |
|
|
|
if nextWatchAdDate != "" { |
|
|
|
nextWatchAdDateValue := egg_system_rules.String2Time(nextWatchAdDate) |
|
|
|
if nextWatchAdDateValue.After(time.Now()) { |
|
|
|
return 0, errors.New("未到可观看时间~~") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//1、查找 `egg_energy_basic_setting` 基础设置 |
|
|
|
eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine) |
|
|
|
eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{ |
|
|
@@ -199,10 +209,10 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin |
|
|
|
return |
|
|
|
} |
|
|
|
fatherRewardValue := rewardValue * (egg_system_rules.StrToFloat64(directPushRewardSetting.RewardRateValue) / 100) |
|
|
|
var fatherSign model.EggSignIn |
|
|
|
if directPushRewardSetting.MemberSelfIsOpenGetTeamReward == "1" { |
|
|
|
fmt.Println("user:::::::::::::", user) |
|
|
|
var m model.EggSignIn |
|
|
|
has, err44 := engine.Where("uid =?", user.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m) |
|
|
|
has, err44 := engine.Where("uid =?", user.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&fatherSign) |
|
|
|
if err44 != nil { |
|
|
|
return rewardValue, err44 |
|
|
|
} |
|
|
@@ -265,6 +275,13 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin |
|
|
|
Uid: vv.Uid, |
|
|
|
Amount: vv.RewardValue, |
|
|
|
}, md2.EggEnergyRoutKeyForSettlementPublicGiveActivityCoin) |
|
|
|
ch.Publish(md2.EggEnergyExchange, md2.EggEnergyTeamAssistanceReq{ |
|
|
|
AssistanceUid: uid, |
|
|
|
Uid: vv.Uid, |
|
|
|
AssistanceValue: vv.RewardValue, |
|
|
|
SignStart: fatherSign.StartTime, |
|
|
|
SignEnd: fatherSign.EndTime, |
|
|
|
}, md2.EggEnergyTeamAssistance) |
|
|
|
} |
|
|
|
} |
|
|
|
err = session.Commit() |
|
|
@@ -315,7 +332,7 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin |
|
|
|
return rewardValue, err2 |
|
|
|
} |
|
|
|
} |
|
|
|
redisKey := fmt.Sprintf(md2.UserNextWatchAdDate, uid) |
|
|
|
|
|
|
|
var watchAdDate string |
|
|
|
if eggEnergyUserWatchRecords.ResidueWatchAdNum == egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum) { |
|
|
|
if eggEnergyUserWatchRecords.NextWatchAdDate.Before(time.Now()) { |
|
|
|