From a1b393a5046b02c90a1aaeb526f328856614bd40 Mon Sep 17 00:00:00 2001 From: Ricsi Date: Tue, 1 Oct 2019 12:08:15 +0200 Subject: [PATCH] include last day of month (expire bug) --- _ajax/money_check.php | 2 +- _class/class_money_deposit.php | 2 +- _cron/money_check.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_ajax/money_check.php b/_ajax/money_check.php index 57da57f..f270852 100644 --- a/_ajax/money_check.php +++ b/_ajax/money_check.php @@ -18,7 +18,7 @@ $users_assoc_array = $sql->assoc_array('SELECT * FROM user_kid WHERE uk_is_activ foreach ($users_assoc_array as $key => $user_array) { $setZero = false; $expDateToNull = false; - if (null !== $user_array['uk_balance_expire_date'] && $user_array['uk_balance_expire_date'] <= date('Y-m-d')) { + if (null !== $user_array['uk_balance_expire_date'] && $user_array['uk_balance_expire_date'] < date('Y-m-d')) { $setZero = true; $expDateToNull = true; } diff --git a/_class/class_money_deposit.php b/_class/class_money_deposit.php index 8172e0d..78a3f7f 100644 --- a/_class/class_money_deposit.php +++ b/_class/class_money_deposit.php @@ -113,7 +113,7 @@ class money_deposit { } } public function is_expired() { - return $this->get_mod_expire_date() <= date('Y-m-d'); + return $this->get_mod_expire_date() < date('Y-m-d'); } public static function create_money_deposit($_user_id, $_date, $_sum, $_lease, $_pt = 1, $_sets_date = false) { diff --git a/_cron/money_check.php b/_cron/money_check.php index 4c48e08..d1698ec 100644 --- a/_cron/money_check.php +++ b/_cron/money_check.php @@ -8,7 +8,7 @@ else $sql = new sql('localhost','livingsp_coach','R186er012qw5','livingsp_badmin //lekérjük az aktív tagokat, végigmegyünk rajtuk //ha az user lejárós - //ha be van állítva expire date és az >= actual_date, akkor nullázás + //ha be van állítva expire date és az < actual_date, akkor nullázás //nullra állítjuk az expire date-et //ha null és (actual date >= last_deposit + 1 hónap VAGY actual date null), akkor nullázás @@ -17,7 +17,7 @@ $users_assoc_array = $sql->assoc_array('SELECT * FROM user_kid WHERE uk_is_activ foreach ($users_assoc_array as $key => $user_array) { $setZero = false; $expDateToNull = false; - if (null !== $user_array['uk_balance_expire_date'] && $user_array['uk_balance_expire_date'] <= date('Y-m-d')) { + if (null !== $user_array['uk_balance_expire_date'] && $user_array['uk_balance_expire_date'] < date('Y-m-d')) { $setZero = true; $expDateToNull = true; }