|
|
|
@@ -155,18 +155,35 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
|
wxGameActionLog.setGameId(gameId); |
|
|
|
|
|
|
|
int playLimit = wxGame.getPlayLimit(); |
|
|
|
int playCreditLimit = wxGame.getPlayCreditLimit(); |
|
|
|
int playCredit = wxGame.getPlayCredit(); |
|
|
|
int AwardLimit = wxGame.getAwardLimit(); |
|
|
|
int playCount = wxGameActionLogMapper.getPlayCount(wxGameActionLog); |
|
|
|
int playCreditCount = wxGameActionLogMapper.getPlayCreditCount(wxGameActionLog); |
|
|
|
int AwardCount = wxGameActionLogMapper.getAwardCount(wxGameActionLog); |
|
|
|
|
|
|
|
boolean playAble = !(( playLimit != 0 && playCount >= playLimit) |
|
|
|
|| (AwardLimit != 0 && AwardCount >= AwardLimit)); |
|
|
|
// boolean playAble = !(( playLimit != 0 && playCount >= playLimit) |
|
|
|
// || (AwardLimit != 0 && AwardCount >= AwardLimit)); |
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap(); |
|
|
|
map.put("playLimit",playLimit); |
|
|
|
map.put("AwardLimit",AwardLimit); |
|
|
|
map.put("playCount",playCount); |
|
|
|
map.put("AwardCount",AwardCount); |
|
|
|
map.put("playLimit",playLimit);//免费次数限制(为0是不限制次数,为-1是不能玩) |
|
|
|
map.put("playCreditLimit",playCreditLimit);//消耗积分次数限制(为0是不限制次数,为-1是不能玩) |
|
|
|
map.put("playCredit",playCredit);//消耗积分数量 |
|
|
|
map.put("AwardLimit",AwardLimit);//中奖次数限制(为0是不限制次数) |
|
|
|
map.put("playCount",playCount);//当前玩的免费次数 |
|
|
|
map.put("playCreditCount",playCreditCount);//当前玩的消耗积分次数 |
|
|
|
map.put("AwardCount",AwardCount);//当前中奖次数 |
|
|
|
|
|
|
|
boolean playAble = true; |
|
|
|
if(AwardLimit != 0 && AwardCount >= AwardLimit){//中奖次数没了,不能完了 |
|
|
|
playAble = false; |
|
|
|
} |
|
|
|
if((playLimit > 0 && playCount >= playLimit) || playLimit < 0){//免费不能玩了 |
|
|
|
if((playCreditLimit > 0 && playCreditCount >= playCreditLimit) || playCreditLimit < 0){//积分不能玩了 |
|
|
|
playAble = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
map.put("playAble",playAble); |
|
|
|
return new ResultData(map); |
|
|
|
} |
|
|
|
|