|
|
|
@@ -114,7 +114,7 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData checkLimit(Long gameId, Long userId) { |
|
|
|
public ResultData getCount(Long gameId, Long userId) { |
|
|
|
|
|
|
|
WxGame wxGame = wxGameMapper.selectByPrimaryKey(gameId); |
|
|
|
if (wxGame == null) |
|
|
|
@@ -130,14 +130,16 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
|
int playCount = wxGameActionLogMapper.getPlayCount(wxGameActionLog); |
|
|
|
int AwardCount = wxGameActionLogMapper.getAwardCount(wxGameActionLog); |
|
|
|
|
|
|
|
if ( playLimit != 0 |
|
|
|
&& playCount >= playLimit) |
|
|
|
return new ResultData(ErrorCode.GAME_PLAY_HAS_BEEN_LIMITED); |
|
|
|
boolean playAble = !(( playLimit != 0 && playCount >= playLimit) |
|
|
|
|| (AwardLimit != 0 && AwardCount >= AwardLimit)); |
|
|
|
|
|
|
|
if (AwardLimit != 0 |
|
|
|
&& AwardCount >= AwardLimit) |
|
|
|
return new ResultData(ErrorCode.GAME_AWARD_HAS_BEEN_LIMITED); |
|
|
|
return new ResultData(playLimit - playCount); |
|
|
|
Map<String,Object> map = new HashMap(); |
|
|
|
map.put("playLimit",playLimit); |
|
|
|
map.put("AwardLimit",AwardLimit); |
|
|
|
map.put("playCount",playCount); |
|
|
|
map.put("AwardCount",AwardCount); |
|
|
|
map.put("playAble",playAble); |
|
|
|
return new ResultData(map); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|