Commit efe387e5018764ba0b5324bf2369dd8890255d48

Authored by 陆恒
1 parent 52b6df9c
Exists in master

提交

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
src/HttpServer/logic/function.go
@@ -75,7 +75,7 @@ func (u *UserData) GetCatPos(catlv int) int { @@ -75,7 +75,7 @@ func (u *UserData) GetCatPos(catlv int) int {
75 75
76 //转盘抽奖 返回抽到的奖项的id 76 //转盘抽奖 返回抽到的奖项的id
77 func (u *UserData) DrawTable() int { 77 func (u *UserData) DrawTable() int {
78 - idx := -1 78 + idx := 1
79 if u.DrawTableCount != 3 { 79 if u.DrawTableCount != 3 {
80 //抽a类型 80 //抽a类型
81 sumrate := float32(0) 81 sumrate := float32(0)
@@ -108,6 +108,9 @@ func (u *UserData) DrawTable() int { @@ -108,6 +108,9 @@ func (u *UserData) DrawTable() int {
108 } 108 }
109 109
110 logger.Info("DrawTable sumrate=%v,randnum=%v,cflist=%+v", sumrate, randnum, cflist) 110 logger.Info("DrawTable sumrate=%v,randnum=%v,cflist=%+v", sumrate, randnum, cflist)
  111 + if len(cflist) > 0 {
  112 + idx = cflist[0].Id
  113 + }
111 for _, v := range cflist { 114 for _, v := range cflist {
112 tmprate += int(v.Rate * 100 / sumrate) 115 tmprate += int(v.Rate * 100 / sumrate)
113 logger.Info("DrawTable tmprate=%v", tmprate) 116 logger.Info("DrawTable tmprate=%v", tmprate)