diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java index 5ba5a7a61..1c894c9b5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -101,13 +101,18 @@ public class WxGameServiceImpl implements WxGameService { wxGameActionLog.setUserId(userId); wxGameActionLog.setGameId(gameId); - if (wxGame.getPlayLimit() != 0 - && wxGameActionLogMapper.getPlayCount(wxGameActionLog) > wxGame.getPlayLimit()) - return new ResultData(ErrorCode.GAME_PLAY_HAS_BEEN_LIMITED); - - if (wxGame.getAwardLimit() != 0 - && wxGameActionLogMapper.getAwardCount(wxGameActionLog) > wxGame.getAwardLimit()) - return new ResultData(ErrorCode.GAME_AWARD_HAS_BEEN_LIMITED); + int playLimit = wxGame.getPlayLimit(); + int AwardLimit = wxGame.getPlayLimit(); + int playCount = wxGameActionLogMapper.getPlayCount(wxGameActionLog); + int AwardCount = wxGameActionLogMapper.getAwardCount(wxGameActionLog); + + if ( playLimit != 0 + && playCount > playLimit) + return new ResultData(ErrorCode.GAME_PLAY_HAS_BEEN_LIMITED,playCount - playLimit ); + + if (AwardLimit != 0 + && AwardCount > AwardLimit) + return new ResultData(ErrorCode.GAME_AWARD_HAS_BEEN_LIMITED,AwardCount - AwardLimit); return new ResultData(); }