Commit 639bbdffb195d70f4720bc77fa551861d7e40d29

Authored by zhangqijia
1 parent da026be2

fix: 一番赏 获取扭蛋机列表,请求参数 coin 改为id

src/actions/CapsuleAction.lua
... ... @@ -17,18 +17,18 @@ function _M.listRpc(agent, data)
17 17 local role = agent.role
18 18 local msg = MsgPack.unpack(data)
19 19 local typ = msg.typ
20   - local coin = msg.coin
  20 + local id = msg.id
21 21  
22 22 local capsules = {}
23 23 if typ == 1 then
24   - local ret = skynet.call(agent.capsule_serv, "lua", "list", coin)
  24 + local ret = skynet.call(agent.capsule_serv, "lua", "list", id)
25 25 if next(ret) then
26 26 for k, v in pairs(ret) do
27 27 capsules[k] = v
28 28 end
29 29 end
30 30 elseif typ == 0 then
31   - local ret = role:getCapsuleList(coin)
  31 + local ret = role:getCapsuleList(id)
32 32 if next(ret) then
33 33 for k, v in pairs(ret) do
34 34 capsules[k] = v
... ...
src/models/RolePlugin.lua
... ... @@ -3153,10 +3153,10 @@ function RolePlugin.bind(Role)
3153 3153 return itemRandomOccupy
3154 3154 end
3155 3155  
3156   - function Role:getCapsuleList(coin)
  3156 + function Role:getCapsuleList(id)
3157 3157 local capsules = {}
3158 3158 for k, v in pairs(self.capsules) do
3159   - if v:getProperty("coin") == coin then
  3159 + if v:getProperty("id") == id then
3160 3160 local onlineCount= v:getOnlineCount()
3161 3161 capsules[k] = {id=v:getProperty("id"), room=v:getProperty("room"), typ=v:getProperty("typ"), people=onlineCount[2], coin= v:getProperty("coin")}
3162 3162 end
... ...
src/services/capsuled.lua
... ... @@ -171,10 +171,10 @@ function CMD.start()
171 171 check_capsules()
172 172 end
173 173  
174   -function CMD.list(coin)
  174 +function CMD.list(id)
175 175 local tmpCapsules = {}
176 176 for k, v in pairs(capsules) do
177   - if v:getProperty("coin") == coin then
  177 + if v:getProperty("id") == id then
178 178 local onlineCount= v:getOnlineCount()
179 179 tmpCapsules[k] = {id=v:getProperty("id"), room=v:getProperty("room"), typ=v:getProperty("typ"), people=onlineCount[2], coin= v:getProperty("coin")}
180 180 end
... ...