Last active
December 19, 2015 15:28
-
-
Save DuaelFr/5976106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get all users of a group who contributed. | |
*/ | |
function _events_resource_get_users_in_group($gid) { | |
$query = db_select('og_membership', 'ogm'); | |
$query->join('node', 'n', "n.nid = ogm.etid AND ogm.entity_type = 'node'"); | |
$query->join('user', 'u', 'n.uid = u.uid'); | |
$query->fields('n', array('uid')) | |
->condition('n.status', 1) | |
->condition('u.status', 1); | |
$result = $query->execute(); | |
return $result->fetchAll(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment