Pārlūkot izejas kodu

支付功能相关修复

mafei 1 gadu atpakaļ
vecāks
revīzija
0d906e2ef0
2 mainītis faili ar 17 papildinājumiem un 11 dzēšanām
  1. 10 10
      script/module/platform/ApiLogic.lua
  2. 7 1
      script/module/topup/BuyLogic.lua

+ 10 - 10
script/module/platform/ApiLogic.lua

@@ -47,12 +47,12 @@ function deliver(oJsonInput,ret)
 	ret.price = oJsonInput.price
 	--ret.region = oJsonInput.region
 	ret.err = ""
-	if not (ret.account and ret.order and ret.type and ret.id and ret.cnt and ret.region) then
+	if not (ret.account and ret.order  and ret.id and ret.cnt ) then -- and ret.type and ret.region
 		ret.result = 6
 		ret.err = "param empty"
 		return ret
 	end
-	
+
 	if DELIVER_CODE_HIS[oJsonInput.order] then
 		ret.result = 4
 		ret.err = "order double"
@@ -70,16 +70,16 @@ function deliver(oJsonInput,ret)
 		if not humanDb then
 			ret.result = 2
 			ret.err = "account not exist"
-            return ret
+			return ret
 		end
 	end
-	
+
 	if not BuyLogic.checkBuy(human,ret) then
-        ret.result = 8
-        ret.err = "check buy fail"
-        return ret
+		ret.result = 8
+		ret.err = "check buy fail"
+		return ret
 	end
-	
+
 	oJsonInput.cmd = "deliver"
 	if online and human.db.middleFlag == nil then
 		if Config.IS_DEBUG then
@@ -97,11 +97,11 @@ function deliver(oJsonInput,ret)
 		human.db.buyOrder = human.db.buyOrder or {}
 		human.db.buyOrder[#human.db.buyOrder + 1] = Util.copyTable(oJsonInput)
 	end
-	
+
 	RoleDBLogic.saveRole(human.db)
 	ret.result = 1
 	Log.write(Log.LOGID_OSS_DELIVER, human.db._id, human.db.account, human.db.name, human.db.lv,oJsonInput.order,oJsonInput.money,oJsonInput.type,oJsonInput.id,oJsonInput.cnt,online and 1 or 0,oJsonInput.region)	
-    return ret
+	return ret
 end
 
 

+ 7 - 1
script/module/topup/BuyLogic.lua

@@ -36,6 +36,7 @@ local AbsWeeklyCardLogic = require("absAct.AbsWeeklyCardLogic")
 local YunYingLogic = require("yunying.YunYingLogic")
 local DoubleChargeLogic = require("absAct.DoubleChargeLogic")
 local MoshouLogic = require("moshou.MoshouLogic")
+local HeroSkinLogic = require("present.HeroSkinLogic")
 
 BUY_CODE_NORMAL = 0   -- 正常调平台的充值接口
 BUY_CODE_WX_KEFU = 1  -- 微信小程序客服充值接口
@@ -212,6 +213,12 @@ end
 function cmd.xiLianGift(human, buyConf)
 	MoshouLogic.xlianGiftBuy(human, buyConf.id)
 end
+
+function cmd.heroSkin(human,buyConf)
+	local buyId = buyConf.id
+	return HeroSkinLogic.buy(human,buyId)
+end
+
 -------------------------------- cmd结束 ----------------------------------
 
 function checkBuy(human, ret)
@@ -267,7 +274,6 @@ function buy(human, arg, nolog)
     else
         YunYingLogic.onBuy(human, buyConf, isFirst, cnt)
     end
-    
 	-- 增加VIP经验
 	if buyConf.vipExp > 0 then
 		VipLogic.addExp(human, buyConf.vipExp)