From 149dd41544446a7ef24738382c232363702fa434 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 29 Sep 2019 22:06:48 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/data/dao/BookDao.kt | 2 +- app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)