fix logic extend from admin

This commit is contained in:
Ibnu Maksum 2024-04-29 13:20:57 +07:00
parent f7deb828ac
commit 980af58eb1
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -738,6 +738,7 @@ switch ($action) {
}
$tur = ORM::for_table('tbl_user_recharges')->find_one($id);
$status = $tur['status'];
if ($status == 'off') {
if (strtotime($tur['expiration'] . ' ' . $tur['time']) > time()) {
// not expired
$expiration = date('Y-m-d', strtotime($tur['expiration'] . " +$days day"));
@ -749,7 +750,6 @@ switch ($action) {
$tur->status = "on";
$tur->save();
App::setToken($stoken, $id);
if ($status == 'off') {
if ($tur['routers'] != 'radius') {
$mikrotik = Mikrotik::info($tur['routers']);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);