diff --git a/src/main/java/app/services/db/PermitionService.java b/src/main/java/app/services/db/PermitionService.java index 133b1e6..3416c69 100644 --- a/src/main/java/app/services/db/PermitionService.java +++ b/src/main/java/app/services/db/PermitionService.java @@ -48,9 +48,9 @@ public class PermitionService { steamID.steam2, status) > 0; } - public int extendPermition(SteamID steamID, Integer amount, String status) { - return jdbcTemplate.update("UPDATE sm_admins SET amount=amount+? WHERE identity LIKE ? AND status LIKE ?", - amount, steamID.steam2, status); + public int extendPermition(SteamID steamID, Integer amount, String status, Long previousTimestamp) { + return jdbcTemplate.update("UPDATE sm_admins SET amount=amount+?, reg_date = ? WHERE identity LIKE ? AND status LIKE ?", + amount, previousTimestamp, steamID.steam2, status); } public int addFreeVIP(SteamID steamID, Integer amount) { @@ -61,7 +61,7 @@ public class PermitionService { //лишняя проверка не будет лишним Permition permition = getPermition(steamID); if (permition == null) return addPermition(steamID, amount, "oa", 20, "VIP", "f13bot.User"); - else if (permition.getStatus().equals("VIP")) return -1 * extendPermition(steamID, amount, "VIP"); + else if (permition.getStatus().equals("VIP")) return -1 * extendPermition(steamID, amount, "VIP", permition.getU_timestamp()); else return 0; }