engelsystem/includes/model/UserGroups_model.php

23 lines
409 B
PHP
Raw Normal View History

2014-08-23 01:55:18 +02:00
<?php
use Engelsystem\Database\DB;
2014-08-23 01:55:18 +02:00
/**
* Returns users groups
2017-01-02 15:43:36 +01:00
*
2017-01-03 03:22:48 +01:00
* @param array $user
* @return array
2014-08-23 01:55:18 +02:00
*/
2017-01-02 03:57:23 +01:00
function User_groups($user)
{
return DB::select('
SELECT `Groups`.*
FROM `UserGroups`
JOIN `Groups` ON `Groups`.`UID`=`UserGroups`.`group_id`
WHERE `UserGroups`.`uid`=?
ORDER BY `UserGroups`.`group_id`
',
[$user['UID']]
);
2014-08-23 01:55:18 +02:00
}