BuyLogic.lua 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. -----------------------------------------
  2. -- 直购
  3. -----------------------------------------
  4. local BuyExcel = require("excel.buy").buy
  5. local TopupExcel = require("excel.buy").topup
  6. local presentExcel = require("excel.present")
  7. local Log = require("common.Log")
  8. local Lang = require("common.Lang")
  9. local Msg = require("core.Msg")
  10. local ObjHuman = require("core.ObjHuman")
  11. local BagLogic = require("bag.BagLogic")
  12. local FcmLogic = require("fcm.FcmLogic")
  13. local PfLogic = require("platform.PfLogic")
  14. local FundLogic = require("present.FundLogic")
  15. local DailyLibaoLogic = require("present.DailyLibaoLogic")
  16. local RichangLibaoLogic = require("present.RichangLibaoLogic")
  17. local TequanShopLogic = require("present.TequanShopLogic")
  18. local TopupLogic = require("topup.TopupLogic")
  19. local VipLogic = require("vip.VipLogic")
  20. local SceneHandler = require("scene.Handler")
  21. local UnionRedBagLogic = require("union.UnionRedBagLogic")
  22. local LimitBuy = require("present.LimitBuy")
  23. local ActCustomizeLogic = require("present.ActCustomizeLogic")
  24. local OpenServerGiftLogic = require("present.OpenServerGiftLogic")
  25. local MonthCard = require("present.MonthCard")
  26. local GiftPackLogic = require("present.GiftPackLogic")
  27. local PremiumGiftLogic = require("absAct.PremiumGiftLogic")
  28. local LimitMangHeLogic = require("present.LimitMangHeLogic")
  29. local Broadcast = require("broadcast.Broadcast")
  30. local MangHeLogic = require("absAct.MangHeLogic")
  31. local HeroGrowUp = require("absAct.HeroGrowUp")
  32. local ItemDefine = require("bag.ItemDefine")
  33. local OverflowFundLogic = require("present.OverflowFundLogic")
  34. local AbsWeeklyCardLogic = require("absAct.AbsWeeklyCardLogic")
  35. local YunYingLogic = require("yunying.YunYingLogic")
  36. local DoubleChargeLogic = require("absAct.DoubleChargeLogic")
  37. local MoshouLogic = require("moshou.MoshouLogic")
  38. local HeroSkinLogic = require("present.HeroSkinLogic")
  39. local OrderExcel = require("excel.warOrder")
  40. local WarOrderLogic = require("shop.WarOrder")
  41. local GiftExcel = require("excel.buy").gift
  42. local GiftLogic = require("topup.GiftLogic")
  43. local VoucherShopLogic = require("voucher.VoucherShopLogic")
  44. local MaiDianDefine = require("MaiDian.MaiDianDefine")
  45. local MainDianLogic = require("MaiDian.MaiDianLogic")
  46. local NewFirstCharge = require("present.NewFirstChargeLogic")
  47. local OneKillGiftLogic = require("present.OneKillGift")
  48. local OpenServerGiftPackage = require("present.OpenServerGiftPackage")
  49. local CommonDefine = require("common.CommonDefine")
  50. local ZhuanpanGift = require("zhuanpan.ZhuanpanGift")
  51. local VoucherInvest = require("voucher.VoucherInvest")
  52. local VoucherSpecialOffer = require("voucher.VoucherSpecialOffer")
  53. local VoucherSpecialOffer = require("voucher.VoucherSpecialOffer")
  54. local CommonActLoginGift = require("absAct.CommonActLoginGift")
  55. local ExcludedAccRechargeIdCfg = require("excel.buy").excludedAccRechargeIds
  56. BUY_CODE_NORMAL = 0 -- 正常调平台的充值接口
  57. BUY_CODE_WX_KEFU = 1 -- 微信小程序客服充值接口
  58. cmd = {}
  59. function initAfterHot()
  60. BuyExcel = require("excel.buy").buy
  61. TopupExcel = require("excel.buy").topup
  62. end
  63. local function GetFirstMark(human)
  64. if not human.db.nFirstBuy then
  65. human.db.nFirstBuy = 0
  66. return false
  67. end
  68. return human.db.nFirstBuy == 0 and false or true
  69. end
  70. local function SetFirstMark(human, nValue)
  71. human.db.nFirstBuy = nValue
  72. end
  73. -- 检查该购买项是否不计入累充,true-不计入, false-计入
  74. local function isExcludedAccRechargeId(buyId)
  75. if not ExcludedAccRechargeIdCfg or not ExcludedAccRechargeIdCfg[1] or not ExcludedAccRechargeIdCfg[1].excludedAccRechargeIds then
  76. return false
  77. end
  78. local excludedAccRechargeIds = ExcludedAccRechargeIdCfg[1].excludedAccRechargeIds
  79. if table.find(excludedAccRechargeIds, buyId) then
  80. return true
  81. end
  82. return false
  83. end
  84. -- 是否充值过
  85. function isChange(human)
  86. if not human.db.topupAcount or human.db.topupAcount <= 0 then
  87. return false
  88. end
  89. return true
  90. end
  91. -- 是否首次购买
  92. function getIsFirst(human,id)
  93. if not human.db.buy or
  94. not human.db.buy[id] then
  95. return true
  96. end
  97. end
  98. -- 购买次数
  99. function getBuyCnt(human,id)
  100. if not human.db.buy or
  101. not human.db.buy[id] then
  102. return 0
  103. end
  104. local cnt = human.db.buy[id].cnt or 0
  105. return cnt
  106. end
  107. -- 双倍购买次数
  108. function getDoubleBuyCnt(human,id)
  109. if not human.db.buy or
  110. not human.db.buy[id] then
  111. return 0
  112. end
  113. local cnt = human.db.buy[id].doubleCnt or 0
  114. return cnt
  115. end
  116. -- 真实价格 某些商品首次购买比较便宜
  117. function getRealPrice(human, buyID, region)
  118. region = human.region or "CN"
  119. local buyConf = BuyExcel[buyID]
  120. if not buyConf then return 0 end
  121. return buyConf[region]
  122. end
  123. local function getRealName(human, buyID, region)
  124. region = human.region or "CN"
  125. local buyConf = BuyExcel[buyID]
  126. if not buyConf then return "" end
  127. if region == "US" then
  128. return buyConf.nameEn
  129. elseif region == "VN" then
  130. return buyConf.nameEn
  131. else
  132. return buyConf.name
  133. end
  134. end
  135. local function getRealProductId(human, buyID, region)
  136. region = human.region or "CN"
  137. local buyConf = BuyExcel[buyID]
  138. if not buyConf then return "" end
  139. if region == "US" and human.phpChanelID == CommonDefine.CHANNEL_TAG_FT then
  140. if human.version == "ios" or human.version == "iostishen" then
  141. return buyConf.productidIos
  142. else
  143. return buyConf.productidEn
  144. end
  145. end
  146. if region == "US" then
  147. return buyConf.productidEn
  148. elseif region == "VN" then
  149. return buyConf.productidEn
  150. else
  151. return buyConf.productid
  152. end
  153. end
  154. -- 封装BuyItem结构体
  155. function fontBuyItem(human, net, buyID)
  156. net.nCanBuyNum = 0
  157. net.disableVoucher = 1
  158. if buyID == 0 then
  159. net.buyID = buyID
  160. net.region = "zuanshi"
  161. net.cost = 0
  162. net.icon = 0
  163. net.name = ""
  164. net.isFirst = 0
  165. net.desc = ""
  166. net.doubleCnt = 0
  167. net.actDoubleCnt = 0
  168. net.useDoubleCnt = 0
  169. net.buyCnt = 0
  170. net.vipExp = 0
  171. net.yuanjia = 0
  172. net.zhekou = 0
  173. net.voucher = 0
  174. net.productId = ""
  175. else
  176. local conf = BuyExcel[buyID]
  177. net.buyID = buyID
  178. local region = human.region or "CN"
  179. net.region = region
  180. net.cost = getRealPrice(human, buyID, region)
  181. net.icon = conf.icon
  182. -- net.name = conf.name
  183. net.name = getRealName(human, buyID, region)
  184. net.isFirst = getIsFirst(human, buyID) and 1 or 0
  185. local giveZuanshi = tonumber(conf.desc)
  186. if giveZuanshi then
  187. if net.isFirst == 1 then
  188. net.desc = tostring(giveZuanshi * 3)
  189. else
  190. net.desc = tostring(giveZuanshi)
  191. end
  192. else
  193. net.desc = conf.desc
  194. end
  195. net.doubleCnt = conf.doubleCnt
  196. local actDouble = YunYingLogic.onCallBack(human,"getDoubleCnt", buyID, true)
  197. net.actDoubleCnt = actDouble or 0
  198. net.useDoubleCnt = getDoubleBuyCnt(human, buyID)
  199. net.buyCnt = getBuyCnt(human, buyID)
  200. net.vipExp = conf.vipExp
  201. net.yuanjia = conf.oCN
  202. net.zhekou = conf.zhekou
  203. net.voucher = conf.Voucher
  204. -- net.productId = conf.productid
  205. net.productId = getRealProductId(human, buyID, region)
  206. net.disableVoucher = conf.disableVoucher or 1
  207. if conf.module and conf.module ~= "" then
  208. local tModule = load("return require(\"" .. conf.module .. "\")")()
  209. if tModule and tModule.GetRemainNum then
  210. net.nCanBuyNum = tModule.GetRemainNum(human, buyID)
  211. end
  212. end
  213. end
  214. end
  215. -------------------------------- cmd开始 ----------------------------------
  216. -- 充值-元宝
  217. function cmd.topup(human, buyConf, isFirst, buyCnt, buyNum)
  218. local args = buyConf.args
  219. local id = args[1]
  220. local config = TopupExcel[id]
  221. local cnt = config.cnt * 2
  222. local doubleCnt = buyConf.doubleCnt
  223. local actDouble = YunYingLogic.onCallBack(human,"getDoubleCnt", config.buyID, true)
  224. if actDouble > 0 then
  225. YunYingLogic.onCallBack(human,"buyCall",config.buyID)
  226. cnt = cnt * 2
  227. else
  228. YunYingLogic.onCallBack(human,"touchSingleReach",config.buyID)
  229. --首冲双倍
  230. if buyCnt < doubleCnt then
  231. cnt = cnt * 2
  232. human.db.buy[config.buyID].doubleCnt = human.db.buy[config.buyID].doubleCnt + 1
  233. end
  234. end
  235. ObjHuman.addZuanshi(human, cnt, "buyTopup")
  236. BagLogic.sendItemGetList(human, {{ItemDefine.ITEM_ZUANSHI_ID, cnt}}, "buyTopup")
  237. TopupLogic.query(human)
  238. end
  239. -- 充值-每日礼包
  240. function cmd.dailyLibao(human, buyConf, isFirst, buyCnt, buyNum)
  241. local id = buyConf.args[1]
  242. DailyLibaoLogic.buyLibao(human, id, buyNum)
  243. end
  244. -- 充值-每周礼包
  245. function cmd.weekLibao(human, buyConf, isFirst, buyCnt, buyNum)
  246. local id = buyConf.args[1]
  247. RichangLibaoLogic.buyLibao(human, RichangLibaoLogic.LIBAOTYPE_WEEK, id, RichangLibaoLogic.RMB_BUY, buyNum)
  248. end
  249. -- 充值-每月礼包
  250. function cmd.monthLibao(human, buyConf, isFirst, buyCnt, buyNum)
  251. local id = buyConf.args[1]
  252. RichangLibaoLogic.buyLibao(human, RichangLibaoLogic.LIBAOTYPE_MONTH, id, RichangLibaoLogic.RMB_BUY, buyNum)
  253. end
  254. -- 成长礼包
  255. function cmd.giftPack(human, buyConf, isFirst, buyCnt, buyNum)
  256. local id = buyConf.args[1]
  257. GiftPackLogic.buyLibao(human, id, buyNum)
  258. end
  259. -- 充值-特权商店
  260. function cmd.tequanShop(human, buyConf, isFirst, buyCnt, buyNum)
  261. local id = buyConf.args[1]
  262. TequanShopLogic.buyLibao(human, id, TequanShopLogic.COST_RMB, buyNum)
  263. end
  264. -- 发公会红包
  265. function cmd.unionRedbag(human,buyConf, isFirst, buyCnt, buyNum)
  266. UnionRedBagLogic.sendRedBagCallBack(human,buyConf.args[1], buyNum)
  267. end
  268. -- 限时抢购
  269. function cmd.limitBuy(human, buyConf, isFirst, buyCnt, buyNum)
  270. LimitBuy.buy(human, buyConf.args[1], buyNum)
  271. end
  272. function cmd.customize(human,buyConf, isFirst, buyCnt, buyNum)
  273. ActCustomizeLogic.onBuyCustomize(human,buyConf.args[1], buyNum)
  274. end
  275. -- 开服好礼
  276. function cmd.openServer(human,buyConf, isFirst, buyCnt, buyNum)
  277. OpenServerGiftLogic.buyGift(human,buyConf.args[1], buyNum)
  278. end
  279. -- 月卡
  280. function cmd.monthCard(human,buyConf, isFirst, buyCnt, buyNum)
  281. MonthCard.buyMonthCard(human,buyConf.args[1], buyNum)
  282. end
  283. --
  284. function cmd.heroGrowUp(human, buyConf, isFirst, buyCnt, buyNum)
  285. HeroGrowUp.buyKing(human, buyNum)
  286. end
  287. function cmd.limitMangHe(human, buyConf, isFirst, buyCnt, buyNum)
  288. LimitMangHeLogic.buy(human, buyConf.id, buyNum)
  289. end
  290. function cmd.overflowFund(human,buyConf, isFirst, buyCnt, buyNum)
  291. OverflowFundLogic.onBuy(human,buyConf.args[1], buyNum)
  292. end
  293. function cmd.xiLianGift(human, buyConf, isFirst, buyCnt, buyNum)
  294. MoshouLogic.xlianGiftBuy(human, buyConf.id, buyNum)
  295. end
  296. function cmd.heroSkin(human,buyConf, isFirst, buyCnt, buyNum)
  297. local buyId = buyConf.id
  298. return HeroSkinLogic.buy(human,buyId, buyNum)
  299. end
  300. function cmd.gift(human,buyConf, isFirst, buyCnt, buyNum)
  301. local buyId = buyConf.id
  302. for id,cfg in pairs(GiftExcel) do
  303. if cfg.buyID == buyId then
  304. GiftLogic.buy(human,id, buyNum)
  305. break
  306. end
  307. end
  308. end
  309. function cmd.warOrder(human,buyConf, isFirst, buyCnt, buyNum)
  310. local buyId = buyConf.id
  311. for _,cfg in pairs(OrderExcel.desc) do
  312. if cfg.buyId == buyId then
  313. WarOrderLogic.warOrderUnlock(human,cfg.type, buyNum)
  314. break
  315. end
  316. end
  317. end
  318. function cmd.voucherbuy(human, buyConf, isFirst, buyCnt, buyNum)
  319. local nBuyID = buyConf.id
  320. VoucherShopLogic.VoucherShop_OnBuyVoucher(human, nBuyID, buyNum)
  321. end
  322. function cmd.newfirstcharge(human, buyConf, isFirst, buyCnt, buyNum)
  323. local nBuyID = buyConf.id
  324. -- print("[cmd.newfirstcharge] nBuyID = "..nBuyID)
  325. NewFirstCharge.onCharge(human, nBuyID, buyNum)
  326. end
  327. function cmd.onekillgift(human, buyConf, isFirst, buyCnt, buyNum)
  328. local nBuyID = buyConf.id
  329. -- print("[cmd.onekillgift] nBuyID = "..nBuyID)
  330. OneKillGiftLogic.onCharge(human, nBuyID, buyNum)
  331. end
  332. function cmd.openServergiftpackage(human, buyConf, isFirst, buyCnt, buyNum)
  333. local nBuyID = buyConf.id
  334. -- print("[cmd.openservergiftpackage] nBuyID = "..nBuyID)
  335. OpenServerGiftPackage.onCharge(human, nBuyID, buyNum)
  336. end
  337. function cmd.zhuanpanGift(human, buyConf, isFirst, buyCnt, buyNum)
  338. local nBuyID = buyConf.id
  339. ZhuanpanGift.onCharge(human, nBuyID, buyNum)
  340. end
  341. function cmd.VoucherInvest(human, buyConf, isFirst, buyCnt, buyNum)
  342. local nBuyID = buyConf.id
  343. VoucherInvest.onCharge(human, nBuyID, buyNum)
  344. end
  345. function cmd.voucherSpecialOffer(human, buyConf, isFirst, buyCnt, buyNum)
  346. local nBuyID = buyConf.id
  347. VoucherSpecialOffer.onCharge(human, nBuyID, buyNum)
  348. end
  349. function cmd.CommonActLoginGift(human, buyConf, isFirst, buyCnt, buyNum)
  350. local nBuyID = buyConf.id
  351. CommonActLoginGift.onCharge(human, nBuyID, buyNum)
  352. end
  353. -------------------------------- cmd结束 ----------------------------------
  354. function checkBuy(human, ret)
  355. local buyID = ret.id
  356. local buyConf = BuyExcel[buyID]
  357. if buyConf then
  358. --临时处理,后续应该要根据web传的货币类型来判断
  359. -- if not buyConf.CN or buyConf.CN ~= ret.money then
  360. -- return false
  361. -- end
  362. local currencyType = "CN"
  363. if ret.channelID and table.find(CommonDefine.SEA_CHANNEL_ARR, ret.channelID) then
  364. currencyType = "US"
  365. end
  366. if not buyConf[currencyType] or buyConf[currencyType] ~= ret.money then
  367. return false
  368. end
  369. return true
  370. end
  371. ret.result = 8
  372. ret.err = buyID..":buy config not exist"
  373. end
  374. function isArgOK(human,buyID,region,money)
  375. local buyConf = BuyExcel[buyID]
  376. if not (buyConf and buyConf[region]) then
  377. return
  378. end
  379. --海外微端统计,会传转换后的美元值,增加多一层判断
  380. if PfLogic.isHaiwaiWeiduan(human) then
  381. if money == buyConf["US"] then
  382. return true
  383. end
  384. end
  385. local checkMoney = getRealPrice(human, buyID, region)
  386. if money ~= checkMoney then
  387. return
  388. end
  389. return true
  390. end
  391. --直购
  392. function buy(human, arg, nolog)
  393. local buyID, buyNum
  394. if type(arg) == "table" then
  395. buyID = arg.buyID
  396. buyNum = arg.buyNum or 1
  397. else
  398. buyID = arg
  399. buyNum = 1
  400. end
  401. local buyConf = BuyExcel[buyID]
  402. local isFirst = getIsFirst(human, buyID)
  403. local cnt = getBuyCnt(human, buyID)
  404. local buyDB = human.db.buy
  405. buyDB[buyID] = buyDB[buyID] or {upTime = {}, cnt=0}
  406. buyDB[buyID].upTime[#buyDB[buyID].upTime + 1] = os.time()
  407. buyDB[buyID].cnt = buyDB[buyID].cnt or 0
  408. buyDB[buyID].cnt = buyDB[buyID].cnt + 1
  409. buyDB[buyID].doubleCnt = buyDB[buyID].doubleCnt or 0
  410. if cmd[buyConf.cmd] then
  411. cmd[buyConf.cmd](human, buyConf, isFirst, buyDB[buyID].doubleCnt, buyNum)
  412. else
  413. YunYingLogic.onBuy(human, buyConf, isFirst, cnt, buyNum)
  414. end
  415. -- 增加VIP经验
  416. if buyConf.vipExp > 0 then
  417. VipLogic.addExp(human, buyConf.vipExp)
  418. end
  419. if not nolog and type(arg) == "table" and arg.order ~= "transaction_id1"then
  420. --Log.write(Log.LOGID_OSS_PAY, human.db._id, human.db.account, human.db.name, human.db.lv,arg.order or "" ,buyID or 0,arg.amt or arg.money or 0,arg.gold or 0,2,arg.region or "")
  421. Log.write(Log.LOGID_OSS_PAY, human.db._id, human.db.newUniqueTag, human.db.name, human.db.lv,arg.order or "" ,buyID or 0,arg.amt or arg.money or 0,arg.gold or 0,2,arg.region or "")
  422. end
  423. if type(arg) == "table" then
  424. afterCharge(human, arg, buyID, buyConf, buyNum)
  425. end
  426. if false == GetFirstMark(human) then
  427. MainDianLogic.MaiDian_Begin(human, MaiDianDefine.MAIDIAN_TYPE_BUY, {nValue = buyID})
  428. SetFirstMark(human, 1)
  429. local RoleLogic = require("role.RoleLogic")
  430. RoleLogic.RoleLogic_QueryHumanInfo(human)
  431. DailyLibaoLogic.ShowAct(human)
  432. RichangLibaoLogic.ShowAct(human)
  433. end
  434. end
  435. function afterCharge(human,oJsonInput, buyID, buyConf, buyNum)
  436. --local price = oJsonInput.topupMoney
  437. local buyConf = BuyExcel[buyID]
  438. local price = oJsonInput.price or buyConf.CN
  439. if price and price > 0 and buyConf.cmd ~= "voucherbuy" and not isExcludedAccRechargeId(buyID) then
  440. TopupLogic.clacTopupAcount(human, price, buyID, buyNum)
  441. local msgRet = Msg.gc.GC_NOTICE_DADIAN
  442. msgRet.type = 1
  443. msgRet.param = oJsonInput.price * 100
  444. msgRet.param2 = tonumber(oJsonInput.buyID)
  445. Msg.send(msgRet,human.fd)
  446. end
  447. end
  448. --直充
  449. function charge(human,oJsonInput)
  450. local gold = oJsonInput.gold
  451. local money = oJsonInput.money
  452. local region = oJsonInput.region
  453. local buyID = oJsonInput.buyID
  454. if buyID and BuyExcel[buyID] then
  455. oJsonInput.id = buyID
  456. buy(human,oJsonInput,true)
  457. else
  458. --直充档次表没有对应配置的话直接给请求中要求的元宝
  459. ObjHuman.addZuanshi(human, gold, "buyTopup")
  460. end
  461. if oJsonInput.order ~= 'transaction_id1' then
  462. --Log.write(Log.LOGID_OSS_PAY, human.db._id, human.db.account, human.db.name, human.db.lv,oJsonInput.order,buyID or 0,oJsonInput.amt or oJsonInput.money,oJsonInput.gold,2,oJsonInput.region)
  463. Log.write(Log.LOGID_OSS_PAY, human.db._id, human.db.newUniqueTag, human.db.name, human.db.lv,oJsonInput.order,buyID or 0,oJsonInput.amt or oJsonInput.money,oJsonInput.gold,2,oJsonInput.region)
  464. end
  465. end
  466. function onLogin(human)
  467. if not human.db.buyOrder then return end
  468. for k,v in ipairs(human.db.buyOrder) do
  469. if v.cmd == "charge" then
  470. buy(human,v)
  471. elseif v.cmd == "deliver" then
  472. charge(human,v)
  473. end
  474. end
  475. human.db.buyOrder = nil
  476. end
  477. -- 判断能不能直购
  478. function checkCanBuy(human, buyID)
  479. local buyConf = BuyExcel[buyID]
  480. if not buyConf then return end
  481. local price = getRealPrice(human, buyID, "CN")
  482. if price and not FcmLogic.checkCanBuy(human, price) then
  483. return
  484. end
  485. if SceneHandler.canCharge(human) ~= true then
  486. return Broadcast.sendErr(human, Lang.CHARGE_CLOSE_TIP)
  487. end
  488. local msgRet = Msg.gc.GC_BUY_CHECK
  489. msgRet.buyCode = BUY_CODE_NORMAL
  490. if PfLogic.isFKW(human) then
  491. -- 方块玩微信小程序的正式服 ios下走客服充值
  492. if human.isIOS == 1 then
  493. msgRet.buyCode = BUY_CODE_WX_KEFU
  494. end
  495. elseif PfLogic.isKunTang(human) then
  496. -- 坤堂微信小程序的正式服 ios和安卓都走客服充值
  497. msgRet.buyCode = BUY_CODE_WX_KEFU
  498. end
  499. fontBuyItem(human, msgRet.buyItem, buyID)
  500. Msg.send(msgRet, human.fd)
  501. end