0
我需要选择具有所有给定角色的用户。 在Model_User我有:kohana orm选择具有所有给定角色的用户
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;
}
但是,这是行不通的。 此致敬礼。
看到这个:http://stackoverflow.com/questions/3552875/kohana-3-auth-module-getting-users-with-员工或经理角色 – Ryan 2014-09-05 13:49:15
谢谢,但我知道这个问题。我需要选择具有两种角色的用户('和',而不是'或')。问候 – masteryoda 2014-09-05 14:20:01