mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 09:26:27 +02:00
add capacity to modify user
This commit is contained in:
parent
f9e0312c89
commit
4a39865903
12 changed files with 687 additions and 143 deletions
|
@ -13,6 +13,18 @@ namespace models;
|
|||
|
||||
class Quota extends StandardModel
|
||||
{
|
||||
/**
|
||||
* Return the quota for a user if it exists.
|
||||
*
|
||||
* @param int $id_user : user id
|
||||
*
|
||||
* @return array : quota if found, else empty array
|
||||
*/
|
||||
public function get_user_quota(int $id_user)
|
||||
{
|
||||
return $this->_select_one($this->get_table_name(), ['id_user' => $id_user]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get remaining credit for a date
|
||||
* if no quota for this user return max int
|
||||
|
@ -168,7 +180,6 @@ namespace models;
|
|||
{
|
||||
$at = $at->format('Y-m-d H:i:s');
|
||||
$where = [
|
||||
'!=expiration_date' => null,
|
||||
'<=expiration_date' => $at,
|
||||
'auto_renew' => true,
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue