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 81c9c6ef1..97f89cd1a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -95,8 +95,9 @@ public class WxGameServiceImpl implements WxGameService { WxGameActionLog wxGameActionLog = new WxGameActionLog(); wxGameActionLog.setUserId(userId); wxGameActionLog.setGameId(gameId); - if (wxGameActionLogMapper.getCount(wxGameActionLog) - > wxGameMapper.selectByPrimaryKey(gameId).getPlayLimit()) + int limit = wxGameMapper.selectByPrimaryKey(gameId).getPlayLimit(); + + if (limit != 0 && wxGameActionLogMapper.getCount(wxGameActionLog) > limit) return new ResultData(ErrorCode.GAME_HAS_BEEN_LIMITED); return new ResultData(); }