|
|
@@ -64,17 +64,10 @@ func HomePage(c *gin.Context) { |
|
|
|
var signPersonalEggEnergy = "0.00" |
|
|
|
var signTeamEggEnergy = "0.00" |
|
|
|
var totalEggEnergy float64 |
|
|
|
//开始时间 以当前时间 往前推多少 |
|
|
|
var videoRewardSystem *md2.VideoRewardSystemStruct |
|
|
|
err = json.Unmarshal([]byte(eggEnergyBasicSetting.VideoRewardSystem), &videoRewardSystem) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
var oneRoundDuration = utils.StrToInt(videoRewardSystem.EachRoundHour) |
|
|
|
startTime := now.Add(-time.Hour * time.Duration(oneRoundDuration)).Format("2006-01-02 15:04:05") |
|
|
|
|
|
|
|
signInDb := implement.NewEggSignInDb(db.Db) |
|
|
|
has, signIn, err := signInDb.EggSignINGetOneByTimeAndUid(startTime, "", user.Id, 0) |
|
|
|
nowStr := now.Format("2006-01-02 15:04:05") |
|
|
|
has, signIn, err := signInDb.EggSignINGetOneByTimeAndUid("", nowStr, user.Id, 0) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
return |
|
|
@@ -246,10 +239,10 @@ func HomePageWatchAdRule(c *gin.Context) { |
|
|
|
var roundRemainingSecs int64 |
|
|
|
now := time.Now() |
|
|
|
//开始时间 以当前时间 往前推多少 |
|
|
|
var oneRoundDuration = utils.StrToInt(videoRewardSystem.EachRoundHour) |
|
|
|
startTime := now.Add(-time.Hour * time.Duration(oneRoundDuration)).Format("2006-01-02 15:04:05") |
|
|
|
signInDb := implement.NewEggSignInDb(db.Db) |
|
|
|
has, signIn, err := signInDb.EggSignINGetOneByTimeAndUid(startTime, "", user.Id, 0) |
|
|
|
nowStr := now.Format("2006-01-02 15:04:05") |
|
|
|
|
|
|
|
has, signIn, err := signInDb.EggSignINGetOneByTimeAndUid("", nowStr, user.Id, 0) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
return |
|
|
|