lyhzzz 2 năm trước cách đây
mục cha
commit
5838aae0f5

+ 3 - 0
src/main/java/com/fdkankan/tk/entity/Room.java

@@ -133,6 +133,9 @@ public class Room implements Serializable {
     private Integer roomUserId;
 
     @TableField(exist = false)
+    private Long roomViewCount;
+
+    @TableField(exist = false)
     private List<Date> useTimeList;
 
     public List<Date> getUseTimeList() {

+ 3 - 0
src/main/java/com/fdkankan/tk/service/impl/RoomServiceImpl.java

@@ -141,6 +141,9 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
         Page<Room> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
         for (Room record : page.getRecords()) {
             record.setVisitPassword(null);
+            Long visitCount = roomVisitLogService.getCountByRoomIds(Arrays.asList(record.getRoomId()));
+
+            record.setRoomViewCount(visitCount);
         }
         return PageInfo.PageInfo(page);
     }

+ 0 - 1
src/main/java/com/fdkankan/tk/service/impl/RoomVisitLogServiceImpl.java

@@ -106,7 +106,6 @@ public class RoomVisitLogServiceImpl extends ServiceImpl<IRoomVisitLogMapper, Ro
     public List<RoomVisitLog> getByRoomId(String roomId) {
         LambdaQueryWrapper<RoomVisitLog> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(RoomVisitLog::getRoomId,roomId);
-        wrapper.eq(RoomVisitLog::getIsHost,1);
         wrapper.isNotNull(RoomVisitLog::getOutRoomTime);
         return this.list(wrapper);
     }