From 46d7198c7984d9e26a0b3fea1c887c7e14b8f41e Mon Sep 17 00:00:00 2001 From: 2008 <59199830@qq.com> Date: Fri, 6 Sep 2024 19:22:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E5=88=86=E7=BB=84=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 书籍分组筛选显示问题 --- entry/src/main/ets/common/utils/booksUtils.ets | 2 +- entry/src/main/ets/database/dao/BooksDao.ets | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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(`(