mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
add stats about credit in use account and update dates for home graph
This commit is contained in:
parent
03ae69b82a
commit
c3637ab3ab
9 changed files with 90 additions and 31 deletions
|
@ -84,10 +84,9 @@ class Quota extends StandardController
|
|||
{
|
||||
$result = $this->get_model()->consume_credit($id_user, $quantity);
|
||||
|
||||
//Enqueue verifications for quotas alerting
|
||||
$queue = msg_get_queue(QUEUE_ID_QUOTA);
|
||||
$message = ['id_user' => $id_user];
|
||||
msg_send($queue, QUEUE_TYPE_QUOTA, $message, true, true);
|
||||
//Write event
|
||||
$internal_event = new Event($this->bdd);
|
||||
$internal_event->create($id_user, 'QUOTA_CONSUME', 'Consume ' . $quantity . ' credits of SMS quota.');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -260,7 +259,7 @@ class Quota extends StandardController
|
|||
}
|
||||
|
||||
echo "Update quota : " . $quota['id'] . "\n";
|
||||
$internal_event->create($quota['id_user'], 'QUOTA_RENEWAL', 'Renew quota ' . $quota['id'] . ' report ' . $report . ' credits.');
|
||||
$internal_event->create($quota['id_user'], 'QUOTA_RENEWAL', 'Renew quota and report ' . $report . ' credits.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue