diff --git a/app/src/main/java/io/legado/app/data/dao/BookDao.kt b/app/src/main/java/io/legado/app/data/dao/BookDao.kt index a174e0829..ccbf8e3c9 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookDao.kt @@ -24,7 +24,7 @@ interface BookDao { @Query("SELECT bookUrl FROM books WHERE `group` = :group") fun observeUrlsByGroup(group: Int): LiveData> - @Query("SELECT bookUrl FROM books WHERE name like '%' | :key | '%' or author like '%' | :key | '%'") + @Query("SELECT bookUrl FROM books WHERE name like '%' || :key || '%' or author like '%' || :key || '%'") fun liveDataSearch(key: String): LiveData> @Query("SELECT * FROM books WHERE `name` in (:names)") diff --git a/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt b/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt index fcd7130ef..81badc15e 100644 --- a/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt @@ -14,7 +14,7 @@ interface SearchKeywordDao { @Query("SELECT * FROM search_keywords ORDER BY lastUseTime DESC") fun liveDataByTime(): LiveData> - @Query("SELECT * FROM search_keywords where word like '%' | :key | '%' ORDER BY usage DESC") + @Query("SELECT * FROM search_keywords where word like '%' || :key || '%' ORDER BY usage DESC") fun liveDataSearch(key: String): LiveData> @Insert(onConflict = OnConflictStrategy.REPLACE)