diff --git a/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java b/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java index 36af643..9492033 100644 --- a/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java +++ b/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java @@ -335,10 +335,10 @@ public class LiveSceneEntity implements Serializable { this.setCarouselImage(false); // 默认 false } if (this.getViewerCount() == null) { - this.setViewerCount(true); // 默认 true + this.setViewerCount(false); // 默认 false } if (this.getLikeDisplay() == null) { - this.setLikeDisplay(true); // 默认 true + this.setLikeDisplay(false); // 默认 false } if (this.getVrLive() == null) { this.setVrLive(false); // 默认 false diff --git a/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java b/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java index 3441ffe..8c3c3cc 100644 --- a/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java +++ b/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java @@ -305,7 +305,10 @@ public class LiveSceneServiceImpl extends ServiceImpl !list.isEmpty()) + .map(list -> list.get(0)) + .orElse(null)); this.baseMapper.insert(entity); LiveSceneCountEntity liveSceneCountEntity = new LiveSceneCountEntity(); @@ -2838,7 +2841,7 @@ public class LiveSceneServiceImpl extends ServiceImpl wrapper = new EntityWrapper<>(); // 添加查询条件:scene_state = 2 - wrapper.eq("scene_state", SceneConstants.SCENE_PROD.intValue()); + wrapper.eq("scene_state", SceneConstants.SCENE_PROD); // 调用 selectCount 方法统计符合条件的行数 Long count = (long) selectCount(wrapper); @@ -2854,7 +2857,9 @@ public class LiveSceneServiceImpl extends ServiceImpl countEntities = liveSceneCountService.selectList(null); + EntityWrapper countWrapper = new EntityWrapper<>(); + countWrapper.eq("scene_state", SceneConstants.SCENE_PROD); + List countEntities = liveSceneCountService.selectList(countWrapper); long sumViews = countEntities.stream().mapToLong(LiveSceneCountEntity::getViewsShow).sum(); result.add(sumViews); return result;