This commit is contained in:
wangjinlei
2023-09-22 11:46:09 +08:00
parent c4cc7fc129
commit 207d336f1e

View File

@@ -204,13 +204,19 @@ public class BookController {
for (UserEbookBuyEntity b :bookids){ for (UserEbookBuyEntity b :bookids){
bids.add(b.getBookId()); bids.add(b.getBookId());
} }
Integer start = (page-1)*limit;
QueryWrapper<BookEntity> wrapper = new QueryWrapper<>(); QueryWrapper<BookEntity> wrapper = new QueryWrapper<>();
wrapper.eq("t.can_listen",1); wrapper.eq("can_listen",1);
wrapper.notIn("t1.Book_id",bids); wrapper.notIn("id",bids);
List<BookEntity> bookEntities = bookDao.queryUserListenBooksNobuy(wrapper,start,limit); Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<BookEntity>(page, limit), wrapper);
Integer count = bookDao.queryUserListenBooksNobuyCount(wrapper); // Integer start = (page-1)*limit;
return R.ok().put("books",bookEntities).put("count",count); // QueryWrapper<BookEntity> wrapper = new QueryWrapper<>();
// wrapper.eq("t.can_listen",1);
// wrapper.notIn("t1.Book_id",bids);
// List<BookEntity> bookEntities = bookDao.queryUserListenBooksNobuy(wrapper,start,limit);
// Integer count = bookDao.queryUserListenBooksNobuyCount(wrapper);
return R.ok().put("page",bookEntityPage);
} }
/** /**