diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index 1927c52..82a2073 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -321,7 +321,8 @@ func HandlerAddgold(w http.ResponseWriter, data string) { break } - rdata.Gold_num = 5 * 2 + //rdata.Gold_num = 5 * 2 + rdata.Gold_num = 5 uinfo, err := GetUserInfo(rdata.Openid) if err != nil || uinfo == nil { logger.Info(" HandlerAddgold getdata failed:%v,for:%v", err, data) @@ -432,14 +433,14 @@ func HandlerFetchproterybox(w http.ResponseWriter, data string) { break } - currkey := "leftcnt_" + DateNowStr() - newleftcnt := GetConcurrency(currkey, rdata.Openid) - if newleftcnt < 1 { - logger.Info(" HandlerFetchproterybox GetConcurrency LeftCnt failed:%v,for:%v", err, data) - resp.RetMsg = "当天领取已达上限" - resp.ErrNum = ERROR_FETCHLIMIT - break - } + //currkey := "leftcnt_" + DateNowStr() + //newleftcnt := GetConcurrency(currkey, rdata.Openid) + //if newleftcnt < 1 { + // logger.Info(" HandlerFetchproterybox GetConcurrency LeftCnt failed:%v,for:%v", err, data) + // resp.RetMsg = "当天领取已达上限" + // resp.ErrNum = ERROR_FETCHLIMIT + // break + //} //判断当前剩余次数 if uinfo.LeftCnt == 0 { @@ -465,6 +466,10 @@ func HandlerFetchproterybox(w http.ResponseWriter, data string) { break } + if cfg.Reward > 0 { + cfg.Reward = int(cfg.Reward/2) + } + //加金币 addgold, sumgold, err := AddCoinToTouTiao(rdata.Openid, 1, cfg.Reward, "每日领取宝箱奖励", "other") if err != nil { @@ -481,8 +486,8 @@ func HandlerFetchproterybox(w http.ResponseWriter, data string) { resp.RetData.Goldnum = addgold resp.RetData.Sumgold = sumgold resp.RetData.Curlevle = uinfo.CalcCurLe() - //resp.RetData.Leftcnt = uinfo.LeftCnt - resp.RetData.Leftcnt = Decrcurrency(currkey, rdata.Openid) + resp.RetData.Leftcnt = uinfo.LeftCnt + //resp.RetData.Leftcnt = Decrcurrency(currkey, rdata.Openid) resp.RetData.Curpoerty = uinfo.Property //保存 -- libgit2 0.21.0