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