Commit 9066d1f190ceef179976712a3503723c48e38c0a
1 parent
fe4115ea
Exists in
master
提交
Showing
1 changed file
with
12 additions
and
11 deletions
Show diff stats
src/HttpServer/logic/logic.go
| ... | ... | @@ -85,8 +85,8 @@ func HandlerSettlement(w http.ResponseWriter, data string, uuid int) { |
| 85 | 85 | if idx != -1 { |
| 86 | 86 | list[idx].RewardNum, _ = strconv.Atoi(rdata.RewardNum) |
| 87 | 87 | for _, vval := range list[idx].List { |
| 88 | - uinfo, err := GetUserInfo(strconv.Itoa(vval.UserId)) | |
| 89 | - if err != nil || uinfo == nil { | |
| 88 | + uinfo1, err := GetUserInfo(strconv.Itoa(vval.UserId)) | |
| 89 | + if err != nil || uinfo1 == nil { | |
| 90 | 90 | continue |
| 91 | 91 | } |
| 92 | 92 | var tmp UserCaiPiaoHistory |
| ... | ... | @@ -95,7 +95,7 @@ func HandlerSettlement(w http.ResponseWriter, data string, uuid int) { |
| 95 | 95 | tmp.CatId, _ = strconv.Atoi(cid) |
| 96 | 96 | tmp.Round = rdata.Round |
| 97 | 97 | tmp.Cnum = vval.ChooseNum |
| 98 | - uinfo.CaiPiaoInfo = append(uinfo.CaiPiaoInfo, tmp) | |
| 98 | + uinfo1.CaiPiaoInfo = append(uinfo1.CaiPiaoInfo, tmp) | |
| 99 | 99 | |
| 100 | 100 | if vval.ChooseNum == tmp.RewardNum { |
| 101 | 101 | list[idx].RewardUser = vval.UserId |
| ... | ... | @@ -104,7 +104,7 @@ func HandlerSettlement(w http.ResponseWriter, data string, uuid int) { |
| 104 | 104 | cfg := jsonconf.GetRedCatConfig(48) |
| 105 | 105 | if cfg != nil { |
| 106 | 106 | |
| 107 | - uinfo.AddRedPackect(cfg.Money, 100) | |
| 107 | + uinfo1.AddRedPackect(cfg.Money, 100) | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | } |
| ... | ... | @@ -131,18 +131,19 @@ func HandlerSettlement(w http.ResponseWriter, data string, uuid int) { |
| 131 | 131 | rewarduser := 0 |
| 132 | 132 | if curr.CurRound == rdata.Round { |
| 133 | 133 | for _, vval := range curr.List { |
| 134 | - uinfo, err := GetUserInfo(strconv.Itoa(vval.UserId)) | |
| 135 | - logger.Info("HandlerSettlement111111111111 uinfo.CaiPiaoInfo=%+v", uinfo.CaiPiaoInfo) | |
| 136 | - if err != nil || uinfo == nil { | |
| 134 | + uinfo2, err := GetUserInfo(strconv.Itoa(vval.UserId)) | |
| 135 | + | |
| 136 | + if err != nil || uinfo2 == nil { | |
| 137 | 137 | continue |
| 138 | 138 | } |
| 139 | + logger.Info("HandlerSettlement111111111111 uinfo.CaiPiaoInfo=%+v", uinfo2.CaiPiaoInfo) | |
| 139 | 140 | var tmp UserCaiPiaoHistory |
| 140 | 141 | tmp.RewardNum, _ = strconv.Atoi(rdata.RewardNum) |
| 141 | 142 | cid := strconv.Itoa(rdata.Round) + strconv.Itoa(vval.ChooseNum) |
| 142 | 143 | tmp.CatId, _ = strconv.Atoi(cid) |
| 143 | 144 | tmp.Round = rdata.Round |
| 144 | 145 | tmp.Cnum = vval.ChooseNum |
| 145 | - uinfo.CaiPiaoInfo = append(uinfo.CaiPiaoInfo, tmp) | |
| 146 | + uinfo2.CaiPiaoInfo = append(uinfo2.CaiPiaoInfo, tmp) | |
| 146 | 147 | |
| 147 | 148 | if vval.ChooseNum == tmp.RewardNum { |
| 148 | 149 | rewarduser = vval.UserId |
| ... | ... | @@ -151,13 +152,13 @@ func HandlerSettlement(w http.ResponseWriter, data string, uuid int) { |
| 151 | 152 | cfg := jsonconf.GetRedCatConfig(48) |
| 152 | 153 | if cfg != nil { |
| 153 | 154 | |
| 154 | - uinfo.AddRedPackect(cfg.Money, 100) | |
| 155 | + uinfo2.AddRedPackect(cfg.Money, 100) | |
| 155 | 156 | } |
| 156 | 157 | |
| 157 | 158 | } |
| 158 | 159 | |
| 159 | - logger.Info("HandlerSettlement2222222222222222222 uinfo.CaiPiaoInfo=%+v", uinfo.CaiPiaoInfo) | |
| 160 | - err = SaveUserInfo(uinfo, strconv.Itoa(vval.UserId)) | |
| 160 | + logger.Info("HandlerSettlement2222222222222222222 uinfo.CaiPiaoInfo=%+v", uinfo2.CaiPiaoInfo) | |
| 161 | + err = SaveUserInfo(uinfo2, strconv.Itoa(vval.UserId)) | |
| 161 | 162 | if err != nil { |
| 162 | 163 | logger.Error("HandlerSettlement err=%v", err) |
| 163 | 164 | } | ... | ... |