diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index 3102beb..ceabb36 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -1,6 +1,7 @@ local _M = {} local md5 = require "md5" +local httpc = require("http.httpc") -- 入口在正式服关闭 -- mock 充值 function _M.rechargeRpc(agent , data) @@ -281,9 +282,33 @@ function _M.dyhxAndroidRechargeRpc(agent, data) end local rechargeHandler = { - ali = function(cp_order_id, rechargeId, result) + ali = function(cp_order_id, rechargeId, cfg, result) + local codeurl = skynet.getenv("codeurl") + local content = { + ["paytype"] = "alipay", + ["rechargeid"] = rechargeId, + ["order"] = cp_order_id, + ["title"] = cfg.title, + ["rmb"] = cfg.rmb, + } + local status, body = httpc.get(codeurl, "/payorder?" .. httpGetFormatData(content), {}) + if status == 200 then + result["orderInfo"] = body + end end, - wx = function(cp_order_id, rechargeId, result) + wx = function(cp_order_id, rechargeId, cfg, result) + local codeurl = skynet.getenv("codeurl") + local content = { + ["paytype"] = "wxpay", + ["rechargeid"] = rechargeId, + ["order"] = cp_order_id, + ["title"] = cfg.title, + ["rmb"] = cfg.rmb, + } + local status, body = httpc.get(codeurl, "/payorder?" .. httpGetFormatData(content), {}) + if status == 200 then + result["orderInfo"] = body + end end, } @@ -305,7 +330,7 @@ function _M.getCpOrderIdRpc(agent, data) result["order"] = partnerOrderId local handler = rechargeHandler[type] if handler then - handler(partnerOrderId, id, result) + handler(partnerOrderId, id, dataSet, result) end SendPacket(actionCodes.Store_getCpOrderIdRpc, MsgPack.pack(result)) diff --git a/src/services/dbseed.lua b/src/services/dbseed.lua index 1926409..d081d4b 100644 --- a/src/services/dbseed.lua +++ b/src/services/dbseed.lua @@ -33,7 +33,7 @@ local function initRedisDb( ... ) return end local redisVal = tonum(redisproxy:hget(tbName, keyName)) - if redisVal < mysqlVal then + if redisVal < mysqlVal or redisVal == 0 then redisproxy:hset(tbName, keyName, mysqlVal) end end -- libgit2 0.21.2