|
|
@@ -235,6 +235,21 @@ func HomePageWatchAdRule(c *gin.Context) { |
|
|
|
if nextWatchAdTimes < 0 { |
|
|
|
nextWatchAdTimes = 0 |
|
|
|
} |
|
|
|
var roundRemainingSecs int64 |
|
|
|
now := time.Now() |
|
|
|
nowStr := now.Format("2006-01-02 15:04:05") |
|
|
|
signInDb := implement.NewEggSignInDb(db.Db) |
|
|
|
has, signIn, err := signInDb.EggSignInGetOne(nowStr, nowStr, user.Id) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
if has { |
|
|
|
roundRemainingSecs = utils.TimeParseStd(signIn.EndTime).Unix() - time.Now().Unix() |
|
|
|
if roundRemainingSecs < 0 { |
|
|
|
roundRemainingSecs = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
utils.FilePutContents("nextWatchAdDate", utils.SerializeStr(map[string]interface{}{ |
|
|
|
"nextWatchAdDate": nextWatchAdDate, |
|
|
@@ -250,6 +265,7 @@ func HomePageWatchAdRule(c *gin.Context) { |
|
|
|
NextWatchAdDate: nextWatchAdDate, |
|
|
|
NextWatchAdSecs: nextWatchAdTimes, |
|
|
|
EachRoundHour: videoRewardSystem.EachRoundHour, |
|
|
|
RoundRemainingSecs: roundRemainingSecs, |
|
|
|
} |
|
|
|
e.OutSuc(c, resp, nil) |
|
|
|
} |
|
|
|