Zero datausage if expired

This commit is contained in:
Ibnu Maksum 2024-08-09 14:41:06 +07:00
parent 3f5ea7251e
commit 85ede07d77
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 10 additions and 1 deletions

View File

@ -25,6 +25,15 @@ class RadiusRest {
// Remove Customer to Mikrotik/Device
function remove_customer($customer, $plan)
{
// set zero data usage
if ($plan['typebp'] == "Limited" && ($plan['limit_type'] == "Data_Limit" || $plan['limit_type'] == "Both_Limit")) {
$cs = ORM::for_table("rad_acct")->where('username', $customer['username'])->findMany();
foreach ($cs as $c) {
$c->acctOutputOctets = 0;
$c->acctInputOctets = 0;
$c->save();
}
}
}
// customer change username

View File

@ -1,3 +1,3 @@
{
"version": "2024.8.8"
"version": "2024.8.9"
}