diff --git a/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseEcoModel.kt b/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseEcoModel.kt index 1e99a9b..b31251f 100644 --- a/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseEcoModel.kt +++ b/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseEcoModel.kt @@ -34,13 +34,13 @@ class DatabaseEcoModel : PlayerSQLProvider { } override fun getTopBalance(top: Int): MutableMap = loggedTransaction { - Account.selectAll().limit(top).associate { + Account.selectAll().limit(top).orderBy(Account.money, SortOrder.DESC).associate { it[Account.uuid] to it[Account.money] }.toMutableMap() } override fun getTopBalance(): MutableMap = loggedTransaction { - Account.selectAll().associate { + Account.selectAll().orderBy(Account.money, SortOrder.DESC).associate { it[Account.uuid] to it[Account.money] }.toMutableMap() } diff --git a/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseMonologModel.kt b/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseMonologModel.kt index 3c99a12..076ef33 100644 --- a/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseMonologModel.kt +++ b/src/main/kotlin/com/github/encryptsl/lite/eco/common/database/models/DatabaseMonologModel.kt @@ -5,6 +5,7 @@ import com.github.encryptsl.lite.eco.common.database.entity.EconomyLog import com.github.encryptsl.lite.eco.common.database.tables.MonologTable import com.github.encryptsl.lite.eco.common.extensions.loggedTransaction import org.bukkit.plugin.Plugin +import org.jetbrains.exposed.sql.SortOrder import org.jetbrains.exposed.sql.deleteAll import org.jetbrains.exposed.sql.insert import org.jetbrains.exposed.sql.selectAll @@ -28,7 +29,7 @@ class DatabaseMonologModel(val plugin: Plugin) : AdapterLogger { } override fun getLog(): List { - val query = loggedTransaction { MonologTable.selectAll() } + val query = loggedTransaction { MonologTable.selectAll().orderBy(MonologTable.timestamp, SortOrder.DESC) } return query.mapNotNull { EconomyLog(it[MonologTable.level], it[MonologTable.log], it[MonologTable.timestamp]) } }