소스 검색

update

master
dengbiao 2 주 전
부모
커밋
fc3cab9bff
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. +11
    -1
      rule/egg_energy/give_activty_coin.go

+ 11
- 1
rule/egg_energy/give_activty_coin.go 파일 보기

@@ -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{}{
@@ -315,7 +325,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()) {


불러오는 중...
취소
저장