From a7232e2b92df506b3e551142846124f9265e5f9a Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Thu, 17 Oct 2024 11:39:15 +0700 Subject: [PATCH] fix unpaid logic --- system/controllers/home.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/system/controllers/home.php b/system/controllers/home.php index fd54423c..38351b0d 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -333,16 +333,12 @@ $unpaid = ORM::for_table('tbl_payment_gateway') ->find_one(); // check expired payments -foreach($unpaid as $up) { - if(strtotime($up['expired_date']) < time() || strtotime($up['created_date'], "+24 HOUR") < time()){ - $up->status = 4; - $up->save(); - }else{ - $unpaids[] = $up; - } +if(strtotime($unpaid['expired_date']) < time() || strtotime($unpaid['created_date'], "+24 HOUR") < time()){ + $unpaid->status = 4; + $unpaid->save(); + $unpaid = []; } - $ui->assign('unpaid', $unpaids); $ui->assign('code', alphanumeric(_get('code'), "-"));