Add page and api for stats about phone sended sms

This commit is contained in:
osaajani 2024-06-25 21:12:48 +02:00
parent 064d6fd941
commit 4f717ef849
11 changed files with 530 additions and 0 deletions

View file

@ -225,6 +225,22 @@ use Exception;
return $this->get_model()->get_last_for_destination_and_user($id_user, $destination);
}
/**
* Get number of sended SMS by day and status between two dates, possibly by sending phone.
*
* @param int $id_user : user id
* @param \DateTime $start_date : Date since which we want the messages
* @param \DateTime $end_date : Date until which we want the messages
* @param ?int $id_phone : Id of the phone to search sended for, null by default get all phones
*
* @return array
*/
public function get_sended_status_stats ($id_user, $start_date, $end_date, ?int $id_phone = null)
{
return $this->get_model()->get_sended_status_stats($id_user, $start_date, $end_date, $id_phone);
}
/**
* Send a SMS message.
*