diff --git a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java index 903884d5..0b328012 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java @@ -71,6 +71,7 @@ public class BookForumArticlesServiceController { wrapper.leftJoin(AuthorEntity.class,AuthorEntity::getId,BookEntity::getAuthorId); wrapper.eq(BookForumArticlesEntity::getDelflag,0); wrapper.eq(BookEntity::getDelFlag,0); + wrapper.eq(BookEntity::getState,0); Page bookForumArticlesEntityPage = bookForumArticlesDao.selectJoinPage(new Page<>(page, limit), BookForumArticlesEntity.class, wrapper); for (BookForumArticlesEntity b : bookForumArticlesEntityPage.getRecords()){ @@ -102,6 +103,7 @@ public class BookForumArticlesServiceController { wrapper.leftJoin(AuthorEntity.class,AuthorEntity::getId,BookEntity::getAuthorId); wrapper.eq(BookForumArticlesEntity::getDelflag,0); wrapper.eq(BookEntity::getDelFlag,0); + wrapper.eq(BookEntity::getState,0); wrapper.orderByDesc(BookForumArticlesEntity::getContlike); Page bookForumArticlesEntityPage = bookForumArticlesDao.selectJoinPage(new Page<>(page, limit), BookForumArticlesEntity.class, wrapper); @@ -152,6 +154,7 @@ public class BookForumArticlesServiceController { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(BookEntity::getDelFlag,0); + wrapper.eq(BookEntity::getState,0); wrapper.exists(ex_sql); wrapper.exists(existSql); Page bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper); @@ -173,10 +176,11 @@ public class BookForumArticlesServiceController { @RequestMapping("/getBestForumsAndBook") public R getBestForumsAndBook(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){ String ex_sql = "select 1 from user_ebook_buy where book.id = book_id and user_id = "+userId; - String existSql = "select 1 from book_forum_articles where book.id = bookid"; + String existSql = "select 1 from book_forum_articles where book.id = bookid and del_flag = 0"; LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(BookEntity::getDelFlag,0); + wrapper.eq(BookEntity::getState,0); wrapper.notExists(ex_sql); wrapper.exists(existSql); Page bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);