Browse Source

kamaz fix 2

master
gsd 2 months ago
parent
commit
831659200a
  1. 8
      src/main/java/app/services/db/PermitionService.java

8
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;
}

Loading…
Cancel
Save