|
@@ -46,13 +46,14 @@ func HappyOrchardGiveWater(eg *xorm.Engine, masterId string, uid int, isMultiple |
|
|
if residueWatchAdNum < 0 { |
|
|
if residueWatchAdNum < 0 { |
|
|
residueWatchAdNum = zhios_order_relate_utils.StrToInt(videoRewardSystem.RewardTotalNum) |
|
|
residueWatchAdNum = zhios_order_relate_utils.StrToInt(videoRewardSystem.RewardTotalNum) |
|
|
} |
|
|
} |
|
|
_, err2 := eg.Insert(&models.HappyOrchardUserWatchRecords{ |
|
|
|
|
|
|
|
|
UserWatchRecords = &models.HappyOrchardUserWatchRecords{ |
|
|
Uid: uid, |
|
|
Uid: uid, |
|
|
NextWatchAdDate: now.Add(time.Hour * time.Duration(zhios_order_relate_utils.StrToInt(videoRewardSystem.EachRoundHour))), |
|
|
NextWatchAdDate: now.Add(time.Hour * time.Duration(zhios_order_relate_utils.StrToInt(videoRewardSystem.EachRoundHour))), |
|
|
ResidueWatchAdNum: zhios_order_relate_utils.StrToInt(videoRewardSystem.RewardTotalNum) - 1, |
|
|
ResidueWatchAdNum: zhios_order_relate_utils.StrToInt(videoRewardSystem.RewardTotalNum) - 1, |
|
|
CreateAt: now, |
|
|
CreateAt: now, |
|
|
UpdateAt: now, |
|
|
UpdateAt: now, |
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
_, err2 := eg.Insert(UserWatchRecords) |
|
|
if err2 != nil { |
|
|
if err2 != nil { |
|
|
return err2 |
|
|
return err2 |
|
|
} |
|
|
} |
|
|