mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Only start daemons for phones of active users
This commit is contained in:
parent
ad1f798ae6
commit
1c7a84def0
5 changed files with 40 additions and 3 deletions
|
@ -13,6 +13,31 @@ namespace models;
|
|||
|
||||
class Phone extends StandardModel
|
||||
{
|
||||
|
||||
/**
|
||||
* Return all hones that belongs to active users
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_all_for_active_users()
|
||||
{
|
||||
$query = '
|
||||
SELECT phone.*
|
||||
FROM phone
|
||||
LEFT JOIN user
|
||||
ON phone.id_user = user.id
|
||||
WHERE user.status = :status
|
||||
';
|
||||
|
||||
$params = [
|
||||
'status' => \models\User::STATUS_ACTIVE,
|
||||
];
|
||||
|
||||
$result = $this->_run_query($query, $params);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a phone by his name and user.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue