diff --git a/src/HttpServer/jsonconf/ActiveWithdrawConfig.json b/src/HttpServer/jsonconf/ActiveWithdrawConfig.json new file mode 100644 index 0000000..0676313 --- /dev/null +++ b/src/HttpServer/jsonconf/ActiveWithdrawConfig.json @@ -0,0 +1,11 @@ +[ + { + "id": 1, + "money": 66, + "coin": 660000, + "task": 0, + "level": 100, + "new": 0, + "day": 30 + } +] \ No newline at end of file diff --git a/src/HttpServer/jsonconf/WithdrawConfig.json b/src/HttpServer/jsonconf/WithdrawConfig.json index 90d5177..5261897 100644 --- a/src/HttpServer/jsonconf/WithdrawConfig.json +++ b/src/HttpServer/jsonconf/WithdrawConfig.json @@ -42,7 +42,7 @@ "task": 4, "level": 17, "new": 0, - "day": 7 + "day": 8 }, { "id": 6, @@ -51,33 +51,24 @@ "task": 5, "level": 23, "new": 0, - "day": 10 + "day": 12 }, { "id": 7, - "money": 10, - "coin": 100000, + "money": 100, + "coin": 10000000, "task": 6, - "level": 68, + "level": 102, "new": 0, "day": 0 }, { "id": 8, - "money": 50, - "coin": 500000, + "money": 200, + "coin": 20000000, "task": 7, "level": 150, "new": 0, "day": 0 - }, - { - "id": 9, - "money": 100, - "coin": 10000000, - "task": 8, - "level": 150, - "new": 0, - "day": 0 } ] \ No newline at end of file diff --git a/src/HttpServer/jsonconf/jsonconf.go b/src/HttpServer/jsonconf/jsonconf.go index 95e3002..41f4625 100644 --- a/src/HttpServer/jsonconf/jsonconf.go +++ b/src/HttpServer/jsonconf/jsonconf.go @@ -67,14 +67,25 @@ type SignConfigDesc struct { Reward SignReward `json:"reward"` } +type ActiveWithdrawConfigDesc struct { + Id int `json:"id"` + Money float32 `json:"money"` + Coin int `json:"coin"` + Task int `json:"task"` + Level int `json:"level"` + Isnew int `json:"new"` + Day int `json:"day"` +} + type GameConfig struct { - AchieventConfig []AchieveDesc - TaskConfig []AchieveDesc - LevelConfig []LevelDesc - MoneyBoxConfig []MoneyBoxLevelDesc - MoneyBoxTimeConfig []MoneyBoxTimesDesc - WithDrawConfig []WithDrawDesc - SignConfig SignConfigDesc + AchieventConfig []AchieveDesc + TaskConfig []AchieveDesc + LevelConfig []LevelDesc + MoneyBoxConfig []MoneyBoxLevelDesc + MoneyBoxTimeConfig []MoneyBoxTimesDesc + WithDrawConfig []WithDrawDesc + SignConfig SignConfigDesc + ActiveWithdrawConfig []ActiveWithdrawConfigDesc } func GetJsonConf() *GameConfig { diff --git a/src/HttpServer/logic/datadef.go b/src/HttpServer/logic/datadef.go index 01bebb4..b242450 100644 --- a/src/HttpServer/logic/datadef.go +++ b/src/HttpServer/logic/datadef.go @@ -125,6 +125,7 @@ type GetcashReq struct { Nickname string `json:"nickname"` Headurl string `json:"headurl"` Ver string `json:"ver"` + Ctype int `json:"ctype"` } type CommReq struct { @@ -325,7 +326,8 @@ type WithDrawRecord struct { } type WithDrawInfo struct { - Cashdata []WithDrawDesc `json:"cashdata"` + Cashdata []WithDrawDesc `json:"cashdata"` + SpecialCashdata []WithDrawDesc `json:"specialcashdata"` } type WithDrawDesc struct { @@ -339,28 +341,29 @@ type WithDrawDesc struct { //玩家数据 type UserData struct { - Userid int //玩家id - Lv int //玩家当前等级 - LvRewardGet int //当前等级奖励是否已经领取 1未领取 2普通领取 3双倍领取 - Exp int //玩家当前经验值 - GuanGold int //玩家存钱罐中金币数量 - RealGold int //玩家实际金币数量(可用于提现的) - WatchAddsTime int //当天剩余红包次数 初始化50次 - LastLoginTime int //上次登陆时间 - ContinueLoginDay int //连续登录天数 - SumLoginDay int //累计登陆天数 - GetFromGuanCnt int //当天从存钱款提取金币次数 - SignRound int //签到轮数 - SignSum int //累计签到天数 - IsSignToday int //今日是否已经签到 1是 0否 - LeftFreeRB int //剩余免费红包次数 - UpLvCostTime int //上一个等级升级时间 - UpLvCostTimeSec int //上一个等级升级的时间点时刻 - ReadNum int //玩家微转发阅读量 - GetCashCnt int //当天提现次数 - WithDraw WithDrawInfo //提现记录信息 - Task TaskInfo //玩家任务完成相关信息 - Achieve AchieveMentInfo //玩家成就完成相关数据 + Userid int //玩家id + Lv int //玩家当前等级 + LvRewardGet int //当前等级奖励是否已经领取 1未领取 2普通领取 3双倍领取 + Exp int //玩家当前经验值 + GuanGold int //玩家存钱罐中金币数量 + RealGold int //玩家实际金币数量(可用于提现的) + WatchAddsTime int //当天剩余红包次数 初始化50次 + LastLoginTime int //上次登陆时间 + ContinueLoginDay int //连续登录天数 + SumLoginDay int //累计登陆天数 + GetFromGuanCnt int //当天从存钱款提取金币次数 + SignRound int //签到轮数 + SignSum int //累计签到天数 + IsSignToday int //今日是否已经签到 1是 0否 + LeftFreeRB int //剩余免费红包次数 + UpLvCostTime int //上一个等级升级时间 + UpLvCostTimeSec int //上一个等级升级的时间点时刻 + ReadNum int //玩家微转发阅读量 + GetCashCnt int //当天提现次数 + WithDraw WithDrawInfo //提现记录信息 + //SpecialWithDraw WithDrawInfo //活跃提现记录信息 + Task TaskInfo //玩家任务完成相关信息 + Achieve AchieveMentInfo //玩家成就完成相关数据 } //---------------------------------------------------------------------------------------------------------------------- diff --git a/src/HttpServer/logic/function.go b/src/HttpServer/logic/function.go index 6545951..6ce45b2 100644 --- a/src/HttpServer/logic/function.go +++ b/src/HttpServer/logic/function.go @@ -506,6 +506,23 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s tmp.Day = val.Day initdata.WithDraw.Cashdata = append(initdata.WithDraw.Cashdata, tmp) } + //处理活跃提现的部分 + for _, val := range jsonconf.GetJsonConf().ActiveWithdrawConfig { + var tmp WithDrawDesc + tmp.Cid = val.Id + tmp.Cnum = val.Money + if val.Isnew == 1 { + tmp.Isnew = 1 + } else { + tmp.Isnew = 2 + } + tmp.Limitlv = val.Level + //没有前置条件 + tmp.Preisfind = 1 + + tmp.Day = val.Day + initdata.WithDraw.SpecialCashdata = append(initdata.WithDraw.SpecialCashdata, tmp) + } resp.Data.Guangold = initdata.GuanGold resp.Data.Leftredbagcnt = initdata.WatchAddsTime @@ -784,6 +801,16 @@ func GetWithDrawList(uuid int) (*WithDrawList, error) { return list, nil } +func (uinfo *UserData) GetSpecialWithDrawData(money float32) (int, *WithDrawDesc) { + //处理提现状态 + for k, val := range uinfo.WithDraw.SpecialCashdata { + if val.Cnum == money { + return k, &val + } + } + return -1, nil +} + func (uinfo *UserData) GetWithDrawData(money float32) (int, *WithDrawDesc) { //处理提现状态 for k, val := range uinfo.WithDraw.Cashdata { diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index e1b81d3..8a9deef 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -141,7 +141,16 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { break } - index, info := uinfo.GetWithDrawData(rdata.Money) + //需要处理一下提现级别 + + index := 0 + var info *WithDrawDesc + if rdata.Ctype == 1 { + index, info = uinfo.GetWithDrawData(rdata.Money) + } else { + index, info = uinfo.GetSpecialWithDrawData(rdata.Money) + } + if index == -1 || info == nil { logger.Error("AddWithDrawList failed err=%v", err) resp.Message = "网络错误" @@ -170,12 +179,15 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { break } - //判断一下前置条件的下一档 - if index == len(uinfo.WithDraw.Cashdata)-1 { - //最后一档了不用处理 - } else { - if index < len(uinfo.WithDraw.Cashdata)-1 { - uinfo.WithDraw.Cashdata[index+1].Preisfind = 1 + //普通提现需要判断前置条件 + if rdata.Ctype == 1 { + //判断一下前置条件的下一档 + if index == len(uinfo.WithDraw.Cashdata)-1 { + //最后一档了不用处理 + } else { + if index < len(uinfo.WithDraw.Cashdata)-1 { + uinfo.WithDraw.Cashdata[index+1].Preisfind = 1 + } } } @@ -196,7 +208,7 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { //2.2.5版本开启自动审核 checkcoin := 2 - if rdata.Ver == "2.2.5" { + if rdata.Ver == "2.2.5" || rdata.Ver == "2.2.6" || rdata.Ver == "2.2.7" { logger.Info("HandlerGetcash autocheckcoin") if drawnum <= 150 { //1.5挡位以下不需要审核 @@ -870,6 +882,7 @@ func HandlerQuerdrawinfo(w http.ResponseWriter, data string, uuid int) { //返回 resp.Data.Cashdata = append(resp.Data.Cashdata, uinfo.WithDraw.Cashdata...) + resp.Data.SpecialCashdata = append(resp.Data.SpecialCashdata, uinfo.WithDraw.SpecialCashdata...) resp.Code = ERROR_OK break -- libgit2 0.21.0