Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MalitsPlus committed Jul 14, 2021
1 parent ea44cf4 commit 3e62cc8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId "com.github.malitsplus.shizurunotes"
minSdkVersion 26
targetSdkVersion 29
versionCode 47
versionName "1.7.2"
versionCode 48
versionName "1.8.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,23 @@ class DBHelper private constructor(
* @return
*/
fun getCharaPromotionBonus(unitId: Int): List<RawPromotionBonus>? {
return getBeanListByRaw(
"""
SELECT *
FROM promotion_bonus
WHERE unit_id=$unitId
ORDER BY promotion_level DESC
""",
RawPromotionBonus::class.java
)
// 考虑国服未实装的情况
val count = getOne("""SELECT COUNT(*)
FROM sqlite_master
WHERE type='table'
AND name='promotion_bonus'""")

return if (count.equals("1")) {
getBeanListByRaw(
"""
SELECT *
FROM promotion_bonus
WHERE unit_id=$unitId
ORDER BY promotion_level DESC
""",
RawPromotionBonus::class.java
)
} else null
}

/***
Expand Down

0 comments on commit 3e62cc8

Please sign in to comment.