Skip to content

Commit

Permalink
书籍分组筛选显示问题
Browse files Browse the repository at this point in the history
书籍分组筛选显示问题
  • Loading branch information
MaoXiaoone committed Sep 6, 2024
1 parent 8bec26c commit 46d7198
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion entry/src/main/ets/common/utils/booksUtils.ets
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class booksUtils{
}
async addBooks(books: Books){
books.isJoin = true
books.bookGroup = 3 //默认未分组
books.bookGroup = books.bookGroup??3 //默认未分组
BooksDao.insert(books)
}
//校验当前书籍是否存在书架中
Expand Down
6 changes: 5 additions & 1 deletion entry/src/main/ets/database/dao/BooksDao.ets
Original file line number Diff line number Diff line change
Expand Up @@ -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(`(
Expand Down

0 comments on commit 46d7198

Please sign in to comment.