Quellcode durchsuchen

修复活动actId为0 问题

249435196@qq.com vor 1 Jahr
Ursprung
Commit
779a0d0efb
1 geänderte Dateien mit 9 neuen und 5 gelöschten Zeilen
  1. 9 5
      script/module/yunying/YunYingLogic.lua

+ 9 - 5
script/module/yunying/YunYingLogic.lua

@@ -196,7 +196,7 @@ DAY_SEC = 24 * 3600
 
 
 -- 指定时间的活动
 -- 指定时间的活动
 local function handleAbsInit(openDay, now, config, funcID)
 local function handleAbsInit(openDay, now, config, funcID)
-   config.actId = 0
+   config.actId = config.actId or 0
    config.adIcon = 0
    config.adIcon = 0
    config.realStartTime = 0
    config.realStartTime = 0
    config.realEndTime = 0
    config.realEndTime = 0
@@ -373,13 +373,15 @@ end
 function getLeftTime(YYInfo, human)
 function getLeftTime(YYInfo, human)
     if not YYInfo then return 0 end
     if not YYInfo then return 0 end
     if not YYInfo.moduleList then return 0 end
     if not YYInfo.moduleList then return 0 end
-
+    local leftTime = 0
     for k, v in pairs(YYInfo.moduleList) do
     for k, v in pairs(YYInfo.moduleList) do
         local funcConfig = getFuncConfig(k)
         local funcConfig = getFuncConfig(k)
         if v.getLeftTime and funcConfig.actId ~= 0 then
         if v.getLeftTime and funcConfig.actId ~= 0 then
-            return v.getLeftTime(human, YYInfo, funcConfig)
+            local rest =  v.getLeftTime(human, YYInfo, funcConfig)
+            leftTime = leftTime < rest and rest or leftTime
         end
         end
     end
     end
+    return leftTime
 end
 end
 
 
 -- 封装结构体
 -- 封装结构体
@@ -397,6 +399,7 @@ local function fontIcon(net, YYInfo, human)
     net.panelID = config.panelID
     net.panelID = config.panelID
     net.pos = config.pos or 0
     net.pos = config.pos or 0
     setCacheRed(human, YYInfo.yyID, red)
     setCacheRed(human, YYInfo.yyID, red)
+
 end
 end
 
 
 -- 运营活动列表
 -- 运营活动列表
@@ -405,7 +408,6 @@ function sendIcons(human)
     local msgRet = Msg.gc.GC_YUNYING_LIST
     local msgRet = Msg.gc.GC_YUNYING_LIST
     msgRet.list[0] = 0
     msgRet.list[0] = 0
     local maxLen = #msgRet.list
     local maxLen = #msgRet.list
-
     for _, YYInfo in pairs(ID2YYInfo) do
     for _, YYInfo in pairs(ID2YYInfo) do
         if isOpen(YYInfo, human, true) and
         if isOpen(YYInfo, human, true) and
             YYInfo.config.pos == YUNYING_POS_TYPE1 then
             YYInfo.config.pos == YUNYING_POS_TYPE1 then
@@ -484,13 +486,15 @@ end
 
 
 -- 活动组信息
 -- 活动组信息
 function sendGroupList(human, panelID)
 function sendGroupList(human, panelID)
+    -- 获取panel运营ID
     local actID = getActIDByPanelID(panelID)
     local actID = getActIDByPanelID(panelID)
     if (not actID or actID < 1 ) and panelID ~= PanelDefine.PANEL_ID_3101 then
     if (not actID or actID < 1 ) and panelID ~= PanelDefine.PANEL_ID_3101 then
         return
         return
     end
     end
-
+    -- 通过运营ID获取运营信息
     local YYInfo = ID2YYInfo[actID]
     local YYInfo = ID2YYInfo[actID]
     if not isOpen(YYInfo, human, true) then
     if not isOpen(YYInfo, human, true) then
+        print("============ panel not open ",panelID)
         return
         return
     end
     end