Skip to content

Instantly share code, notes, and snippets.

@mhovey
Created January 23, 2014 17:54
Show Gist options
  • Select an option

  • Save mhovey/8583456 to your computer and use it in GitHub Desktop.

Select an option

Save mhovey/8583456 to your computer and use it in GitHub Desktop.
<?php
return DB::select('
SELECT
users.id,
users.email,
users.full_name,
users.created_at,
user_roles.role_id,
user_roles.website_id,
roles.name
FROM
users
JOIN user_roles ON
users.id = user_roles.user_id
JOIN roles ON
user_roles.role_id = roles.id
WHERE
user_roles.website_id = ?
', array( $this->id ));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment