【发布时间】:2014-09-05 13:33:10
【问题描述】:
我需要选择具有所有给定角色的用户。 在 Model_User 我有:
public function getUsers() {
$users = $this
->join('roles_users')->on('roles_users.user_id', '=', 'user.id')
->where('role_id', '=', ORM::factory('Role', array('name' => 'login')))
->and_where('role_id', '=', ORM::factory('Role', array('name' => 'simple_user')));
return $users;
}
但这不起作用。 问候。
【问题讨论】:
-
谢谢,但我知道这个问题。我需要同时选择具有两个角色的用户(“和”,而不是“或”)。问候