Update sending functions to correctly use phone limits and priority

This commit is contained in:
osaajani 2023-02-06 03:42:03 +01:00
parent 9b7907ad18
commit 715afd79ec
4 changed files with 51 additions and 16 deletions

View file

@ -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.
*