瀏覽代碼

查签到记录调整

master
huangjiajun 2 週之前
父節點
當前提交
65ba633453
共有 2 個文件被更改,包括 8 次插入33 次删除
  1. +2
    -20
      app/hdl/hdl_add_friend.go
  2. +6
    -13
      app/hdl/hdl_home_page.go

+ 2
- 20
app/hdl/hdl_add_friend.go 查看文件

@@ -493,27 +493,9 @@ func TotalRate(c *gin.Context) {
return
}
now := time.Now()
//开始时间 以当前时间 往前推多少
//1、查找 `egg_energy_basic_setting` 基础设置
eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(db.Db)
eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{
"key": "is_open",
"value": 1,
})
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
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)
exit, signIn, err := signInDb.EggSignINGetOneByTimeAndUid(startTime, "", user.Id, 0)
nowStr := now.Format("2006-01-02 15:04:05")
exit, signIn, err := signInDb.EggSignINGetOneByTimeAndUid("", nowStr, user.Id, 0)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return


+ 6
- 13
app/hdl/hdl_home_page.go 查看文件

@@ -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


Loading…
取消
儲存