Commit d337745d6ffa03259756b66e717267fec1fd0094
1 parent
ad77ccd7
Exists in
master
提交
Showing
2 changed files
with
14 additions
and
0 deletions
Show diff stats
src/HttpServer/logic/function.go
@@ -207,6 +207,7 @@ func (u *UserData) CalcRandRedBagNum() float32 { | @@ -207,6 +207,7 @@ func (u *UserData) CalcRandRedBagNum() float32 { | ||
207 | } else { | 207 | } else { |
208 | addnum = float32(rand.Intn(10)) / 100 | 208 | addnum = float32(rand.Intn(10)) / 100 |
209 | } | 209 | } |
210 | + | ||
210 | return addnum | 211 | return addnum |
211 | } | 212 | } |
212 | 213 |
src/HttpServer/logic/logic.go
@@ -2315,6 +2315,19 @@ func HandlerQueryBuyCat(w http.ResponseWriter, data string, uuid int) { | @@ -2315,6 +2315,19 @@ func HandlerQueryBuyCat(w http.ResponseWriter, data string, uuid int) { | ||
2315 | tmp.Coin = strconv.FormatInt(v.CurPrice, 10) | 2315 | tmp.Coin = strconv.FormatInt(v.CurPrice, 10) |
2316 | resp.Data = append(resp.Data, tmp) | 2316 | resp.Data = append(resp.Data, tmp) |
2317 | } | 2317 | } |
2318 | + _, highest := uinfo.CalcHigestCatName() | ||
2319 | + offset := highest - len(uinfo.BuyCatInfo) | ||
2320 | + if offset > 0 { | ||
2321 | + for i := 0; i < offset; i++ { | ||
2322 | + cfg := jsonconf.GetCatConfig(len(uinfo.BuyCatInfo) + i + 1) | ||
2323 | + if cfg != nil { | ||
2324 | + var tmp BuyCatDesc | ||
2325 | + tmp.CatId = len(uinfo.BuyCatInfo) + i + 1 | ||
2326 | + tmp.Coin = cfg.Price | ||
2327 | + resp.Data = append(resp.Data, tmp) | ||
2328 | + } | ||
2329 | + } | ||
2330 | + } | ||
2318 | 2331 | ||
2319 | resp.Code = 0 | 2332 | resp.Code = 0 |
2320 | break | 2333 | break |