run_hook on cron forgot to uncomment

This commit is contained in:
Ibnu Maksum
2024-06-21 16:05:05 +07:00
parent f6ff09957e
commit b0c718b8fd
2 changed files with 18 additions and 3 deletions

View File

@ -21,7 +21,7 @@ $textExpired = Lang::getNotifText('expired');
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->where_lte('expiration', date("Y-m-d"))->find_many();
echo "Found " . count($d) . " user(s)\n";
//run_hook('cronjob'); #HOOK
run_hook('cronjob'); #HOOK
foreach ($d as $ds) {
$date_now = strtotime(date("Y-m-d H:i:s"));
@ -55,7 +55,7 @@ foreach ($d as $ds) {
$p['price'] += $add_cost;
}
}
if ($p && $p['enabled'] && $c['balance'] >= $p['price']) {
if ($p && $c['balance'] >= $p['price']) {
if (Package::rechargeUser($ds['customer_id'], $ds['routers'], $p['id'], 'Customer', 'Balance')) {
// if success, then get the balance
Balance::min($ds['customer_id'], $p['price']);