Przeglądaj źródła

查签到记录调整

master
huangjiajun 2 tygodni temu
rodzic
commit
65ba633453
2 zmienionych plików z 8 dodań i 33 usunięć
  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 Wyświetl plik

@@ -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 Wyświetl plik

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


Ładowanie…
Anuluj
Zapisz