BuyLogic.lua 17 KB

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