diff --git a/entry/src/main/ets/common/utils/booksUtils.ets b/entry/src/main/ets/common/utils/booksUtils.ets index ca3fdc6f..a56c0220 100644 --- a/entry/src/main/ets/common/utils/booksUtils.ets +++ b/entry/src/main/ets/common/utils/booksUtils.ets @@ -17,7 +17,7 @@ class booksUtils{ } async addBooks(books: Books){ books.isJoin = true - books.bookGroup = 3 //默认未分组 + books.bookGroup = books.bookGroup??3 //默认未分组 BooksDao.insert(books) } //校验当前书籍是否存在书架中 diff --git a/entry/src/main/ets/database/dao/BooksDao.ets b/entry/src/main/ets/database/dao/BooksDao.ets index b5799a9a..7031f822 100644 --- a/entry/src/main/ets/database/dao/BooksDao.ets +++ b/entry/src/main/ets/database/dao/BooksDao.ets @@ -120,7 +120,11 @@ class BooksDao { whereClause.push(`bookType = ${type}`); } if (bookGroup !== undefined && bookGroup !== 2) { - whereClause.push(`bookGroup = ${bookGroup}`); + if (bookGroup === 4) { + whereClause.push(`bookGroup = ${bookGroup} or isLocalBook = ${true}`); + } else { + whereClause.push(`bookGroup = ${bookGroup}`); + } } if (searchKey) { whereClause.push(`(