From 87a626dedb2d65e0bf0deb23b3fb7dac742b664a Mon Sep 17 00:00:00 2001 From: Prophet731 Date: Sun, 27 Dec 2015 00:07:14 -0800 Subject: [PATCH] Added files for future release --- app/bfacp/Commands/InfractionsCleanup.php | 54 +++++++++++++++++++ public/js/templates/modals/player/groups.html | 12 +++++ 2 files changed, 66 insertions(+) create mode 100644 app/bfacp/Commands/InfractionsCleanup.php create mode 100644 public/js/templates/modals/player/groups.html diff --git a/app/bfacp/Commands/InfractionsCleanup.php b/app/bfacp/Commands/InfractionsCleanup.php new file mode 100644 index 000000000..a050df6d4 --- /dev/null +++ b/app/bfacp/Commands/InfractionsCleanup.php @@ -0,0 +1,54 @@ +where('total_points', '<', 0)->chunk(1000, function ($infractions) { + foreach ($infractions as $infraction) { + $total = abs($infraction->total_points); + + if ($infraction->forgive_points > 0 && $infraction->punish_points == 0) { + $total = $infraction->forgive_points; + } elseif ($infraction->forgive_points > $infraction->punish_points) { + $total = $infraction->forgive_points - $infraction->punish_points; + } + + $this->info(sprintf('Deleted %s forgives for %s', $total, $infraction->player->SoldierName)); + sleep(0.5); + } + }); + } + +} diff --git a/public/js/templates/modals/player/groups.html b/public/js/templates/modals/player/groups.html new file mode 100644 index 000000000..2e9aa1de9 --- /dev/null +++ b/public/js/templates/modals/player/groups.html @@ -0,0 +1,12 @@ + + + + +