Commit 915358c82bd5e2cceffab2d4cdae097b685826d9
1 parent
8f499bee
Exists in
master
and in
4 other branches
提交
Showing
2 changed files
with
8 additions
and
6 deletions
Show diff stats
src/HttpServer/logic/function.go
| ... | ... | @@ -224,7 +224,7 @@ func AddWithDrawList(uuid int,data *WithDrawRecord) error { |
| 224 | 224 | return err |
| 225 | 225 | } |
| 226 | 226 | list.Withdata = append(list.Withdata,*data) |
| 227 | - savestr,err := json.Marshal(&list) | |
| 227 | + savestr,err := json.Marshal(list) | |
| 228 | 228 | if err != nil { |
| 229 | 229 | return err |
| 230 | 230 | } | ... | ... |
src/HttpServer/logic/logic.go
| ... | ... | @@ -130,10 +130,7 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { |
| 130 | 130 | break |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - uinfo.RealGold -= drawnum * 100 | |
| 134 | 133 | |
| 135 | - resp.Data.Walletgold = uinfo.RealGold | |
| 136 | - SaveUserInfo(uinfo) | |
| 137 | 134 | |
| 138 | 135 | //需要保存一下提现记录 |
| 139 | 136 | data := new(WithDrawRecord) |
| ... | ... | @@ -142,11 +139,16 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { |
| 142 | 139 | err = AddWithDrawList(uuid,data) |
| 143 | 140 | if err != nil { |
| 144 | 141 | logger.Error("AddWithDrawList failed err=%v", err) |
| 145 | - resp.Message = "添加提现记录失败" | |
| 146 | - resp.Code = ERROR_ADDWITHDRAW_LISTFAILED | |
| 142 | + resp.Message = "网络错误" | |
| 143 | + resp.Code = ERROR_SRV_ERROR | |
| 147 | 144 | break |
| 148 | 145 | } |
| 149 | 146 | |
| 147 | + uinfo.RealGold -= drawnum * 100 | |
| 148 | + | |
| 149 | + resp.Data.Walletgold = uinfo.RealGold | |
| 150 | + SaveUserInfo(uinfo) | |
| 151 | + | |
| 150 | 152 | |
| 151 | 153 | resp.Code = ERROR_OK |
| 152 | 154 | break | ... | ... |