gitxsm 2 هفته پیش
والد
کامیت
09de419fd9
3فایلهای تغییر یافته به همراه26 افزوده شده و 1 حذف شده
  1. 2 0
      script/common/LogDefine.lua
  2. 6 0
      script/module/topup/BuyLogic.lua
  3. 18 1
      script/module/voucher/VoucherSpecialOffer.lua

+ 2 - 0
script/common/LogDefine.lua

@@ -330,6 +330,8 @@ DEFINE = {
 	AnniversaryActiveWheel  = 788,			-- 周年庆活动-活跃度转盘
 	BaiZhanChengShen		= 789,			-- 百战成神
 	skinGift				= 790,			-- 华丽皮肤礼包
+	roleDailyGift			= 791,			-- 每日好礼(小7渠道)
+	VoucherSpecialOffer		= 792,			-- 代金券特惠
 
 	errHandle				= 99999,		-- 异常处理
 }

+ 6 - 0
script/module/topup/BuyLogic.lua

@@ -37,6 +37,7 @@ local YunYingLogic = require("yunying.YunYingLogic")
 local DoubleChargeLogic = require("absAct.DoubleChargeLogic")
 local MoshouLogic = require("moshou.MoshouLogic")
 local HeroSkinLogic = require("present.HeroSkinLogic")
+local SkinGiftLogic = require("skin.SkinGiftLogic")
 local OrderExcel = require("excel.warOrder")
 local WarOrderLogic = require("shop.WarOrder")
 local GiftExcel = require("excel.buy").gift
@@ -402,6 +403,11 @@ function cmd.voucherSpecialOffer(human, buyConf, isFirst, buyCnt, buyNum)
 	VoucherSpecialOffer.onCharge(human, nBuyID, buyNum)
 end
 
+function cmd.skinGift(human, buyConf, isFirst, buyCnt, buyNum)
+	local nBuyID = buyConf.id
+	SkinGiftLogic.onCharge(human, nBuyID, buyNum)
+end
+
 function cmd.CommonActLoginGift(human, buyConf, isFirst, buyCnt, buyNum)
 	local nBuyID = buyConf.id
 	CommonActLoginGift.onCharge(human, nBuyID, buyNum)

+ 18 - 1
script/module/voucher/VoucherSpecialOffer.lua

@@ -10,11 +10,18 @@ local BagLogic = require("bag.BagLogic")
 local BuyLogic = require("topup.BuyLogic")
 local YunYingLogic = require("yunying.YunYingLogic")
 local VoucherShopLogic = require("voucher.VoucherShopLogic")
+local CommonDefine = require("common.CommonDefine")
 local giftConfig = require("excel.VoucherSpecialOffer").gift
 
 local LOGTYPE = "VoucherSpecialOffer"
 local VOUCHERSHOP_ACTID = 27
 
+local function isXiaoQiChannel(human)
+    local channelID = human.db.phpChanelID or human.phpChanelID
+    return channelID == CommonDefine.CHANNEL_TAG_XIAOQI
+        or channelID == tostring(CommonDefine.CHANNEL_TAG_XIAOQI)
+end
+
 local function getCfg(buyId)
     for _, v in ipairs(giftConfig) do
         if buyId == v.buyId then
@@ -28,6 +35,9 @@ local function updateIcon(human)
 end
 
 function isOpen(human, YYInfo, funcConfig)
+    if not isXiaoQiChannel(human) then
+        return false
+    end
     return VoucherShopLogic.isOpen(human, YYInfo, funcConfig)
 end
 
@@ -36,6 +46,9 @@ function isRed(human)
 end
 
 function updateDaily(human)
+    if not isOpen(human) then
+        return
+    end
     human.db.voucherSpecialOfferData = nil
     if human.fd then
         VoucherSpecialOffer_Query(human)
@@ -69,7 +82,7 @@ end
 
 function onCharge(human, buyId, buyNum)
     if not isOpen(human) then
-        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+        return
     end
 
     local giftCfg = getCfg(buyId)
@@ -101,6 +114,10 @@ function onCharge(human, buyId, buyNum)
 end
 
 function GetRemainNum(human, nBuyID)
+    if not isOpen(human) then
+        return 0
+    end
+
     local giftCfg = getCfg(nBuyID)
     if not giftCfg then
         return 0