mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-23 09:56:34 +02:00
Update sending functions to correctly use phone limits and priority
This commit is contained in:
parent
9b7907ad18
commit
715afd79ec
4 changed files with 51 additions and 16 deletions
|
@ -178,6 +178,20 @@ namespace models;
|
|||
return $this->_select_one('sended', ['id_user' => $id_user, 'uid' => $uid, 'adapter' => $adapter]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number of sended SMS since a date for a phone
|
||||
*
|
||||
* @param int $id_user : User id
|
||||
* @param int $id_phone : Phone id we want the number of sended message for
|
||||
* @param \DateTime $since : Date since which we want sended number
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count_since_for_phone_and_user(int $id_user, int $id_phone, \DateTime $since) : int
|
||||
{
|
||||
return $this->_count('sended', ['id_user' => $id_user, 'id_phone' => $id_phone, '>=at' => $since]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number of sended SMS for every date since a date for a specific user.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue