From fc56f377a195a24ba7d7e5c51ae403613b10f85e Mon Sep 17 00:00:00 2001 From: lvxinran Date: Thu, 13 May 2021 14:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=A4=BC=E5=8C=85=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jieling/logic/store/BuyGoodsNewLogic.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsNewLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsNewLogic.java index 1e42a42fa..954c61f4e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsNewLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsNewLogic.java @@ -430,6 +430,7 @@ public class BuyGoodsNewLogic { * 刷新单个礼包状态 */ public static boolean refreshUnitWF(AbstractWelfareBag bag,User user){ + SRechargeCommodityNewConfig configById = SRechargeCommodityNewConfig.getConfigById(bag.getModId()); boolean result = false; //判断刷新时间 if(bag.getRefreshTime() != 0 && bag.getRefreshTime() < System.currentTimeMillis()){ @@ -446,11 +447,16 @@ public class BuyGoodsNewLogic { user.getPlayerInfoManager().getNewRechargeInfo().removePush((PushWelfareBag) bag); return true; } - if(bag.getType() == RechargeType.timeLimit.getType()){//活动类型特殊处理 - for(String[] I : bag.getCondition()){ - if(I[0].equals("3")){ - if(ActivityLogic.checkActivityOpen(user,Integer.parseInt(I[1]))){ - long[] time = ActivityLogic.getStartAndEndTime(user,Integer.parseInt(I[1])); + if(bag.getType() == RechargeType.timeLimit.getType()){ + //活动类型特殊处理 + //todo 其他的也要改 直接读表里的 不读数据库里的 + String onSaleRule = configById.getOnSaleRule(); + int[] condition = null; + if(!onSaleRule.contains("|")){ + condition = StringUtil.parseFiledInt(onSaleRule); + if(condition[0]==3){ + if(ActivityLogic.checkActivityOpen(user,condition[1])){ + long[] time = ActivityLogic.getStartAndEndTime(user,condition[1]); bag.setStartTime(time[0]); bag.setEndTime(time[1]); bag.setOpen(true);