forum bug
This commit is contained in:
@@ -71,6 +71,7 @@ public class BookForumArticlesServiceController {
|
|||||||
wrapper.leftJoin(AuthorEntity.class,AuthorEntity::getId,BookEntity::getAuthorId);
|
wrapper.leftJoin(AuthorEntity.class,AuthorEntity::getId,BookEntity::getAuthorId);
|
||||||
wrapper.eq(BookForumArticlesEntity::getDelflag,0);
|
wrapper.eq(BookForumArticlesEntity::getDelflag,0);
|
||||||
wrapper.eq(BookEntity::getDelFlag,0);
|
wrapper.eq(BookEntity::getDelFlag,0);
|
||||||
|
wrapper.eq(BookEntity::getState,0);
|
||||||
Page<BookForumArticlesEntity> bookForumArticlesEntityPage = bookForumArticlesDao.selectJoinPage(new Page<>(page, limit), BookForumArticlesEntity.class, wrapper);
|
Page<BookForumArticlesEntity> bookForumArticlesEntityPage = bookForumArticlesDao.selectJoinPage(new Page<>(page, limit), BookForumArticlesEntity.class, wrapper);
|
||||||
|
|
||||||
for (BookForumArticlesEntity b : bookForumArticlesEntityPage.getRecords()){
|
for (BookForumArticlesEntity b : bookForumArticlesEntityPage.getRecords()){
|
||||||
@@ -102,6 +103,7 @@ public class BookForumArticlesServiceController {
|
|||||||
wrapper.leftJoin(AuthorEntity.class,AuthorEntity::getId,BookEntity::getAuthorId);
|
wrapper.leftJoin(AuthorEntity.class,AuthorEntity::getId,BookEntity::getAuthorId);
|
||||||
wrapper.eq(BookForumArticlesEntity::getDelflag,0);
|
wrapper.eq(BookForumArticlesEntity::getDelflag,0);
|
||||||
wrapper.eq(BookEntity::getDelFlag,0);
|
wrapper.eq(BookEntity::getDelFlag,0);
|
||||||
|
wrapper.eq(BookEntity::getState,0);
|
||||||
wrapper.orderByDesc(BookForumArticlesEntity::getContlike);
|
wrapper.orderByDesc(BookForumArticlesEntity::getContlike);
|
||||||
Page<BookForumArticlesEntity> bookForumArticlesEntityPage = bookForumArticlesDao.selectJoinPage(new Page<>(page, limit), BookForumArticlesEntity.class, wrapper);
|
Page<BookForumArticlesEntity> bookForumArticlesEntityPage = bookForumArticlesDao.selectJoinPage(new Page<>(page, limit), BookForumArticlesEntity.class, wrapper);
|
||||||
|
|
||||||
@@ -152,6 +154,7 @@ public class BookForumArticlesServiceController {
|
|||||||
|
|
||||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(BookEntity::getDelFlag,0);
|
wrapper.eq(BookEntity::getDelFlag,0);
|
||||||
|
wrapper.eq(BookEntity::getState,0);
|
||||||
wrapper.exists(ex_sql);
|
wrapper.exists(ex_sql);
|
||||||
wrapper.exists(existSql);
|
wrapper.exists(existSql);
|
||||||
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
@@ -173,10 +176,11 @@ public class BookForumArticlesServiceController {
|
|||||||
@RequestMapping("/getBestForumsAndBook")
|
@RequestMapping("/getBestForumsAndBook")
|
||||||
public R getBestForumsAndBook(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
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 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<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(BookEntity::getDelFlag,0);
|
wrapper.eq(BookEntity::getDelFlag,0);
|
||||||
|
wrapper.eq(BookEntity::getState,0);
|
||||||
wrapper.notExists(ex_sql);
|
wrapper.notExists(ex_sql);
|
||||||
wrapper.exists(existSql);
|
wrapper.exists(existSql);
|
||||||
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
|
|||||||
Reference in New Issue
Block a user