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