修改获取用户可听书列表bug

This commit is contained in:
wuchunlei
2025-07-09 15:22:24 +08:00
parent 546e7851d0
commit fc710d93e1

View File

@@ -119,12 +119,12 @@ public class UserEbookBuyController {
*/
@RequestMapping("/getUserCanlistenBooks")
public R getUserCanlistenBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
MPJLambdaWrapper<BookEntity> wrapper = new MPJLambdaWrapper<BookEntity>();
MPJLambdaWrapper<BookEntity> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(BookEntity.class);
wrapper.leftJoin(UserEbookBuyEntity.class,UserEbookBuyEntity::getBookId,BookEntity::getId);
wrapper.eq(UserEbookBuyEntity::getUserId,userId);
wrapper.groupBy(UserEbookBuyEntity::getBookId);
Page<BookEntity> bookEntityPage = bookDao.selectJoinPage(new Page<BookEntity>(page, limit), BookEntity.class, wrapper);
Page<BookEntity> bookEntityPage = bookDao.selectPage(new Page<>(page, limit), wrapper);
return R.ok().put("page",bookEntityPage);
}