Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

MSSQL fix #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Bican/Roles/Traits/HasRoleAndPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ public function rolePermissions()
throw new InvalidArgumentException('[roles.models.permission] must be an instance of \Illuminate\Database\Eloquent\Model');
}

return $permissionModel::select(['permissions.*', 'permission_role.created_at as pivot_created_at', 'permission_role.updated_at as pivot_updated_at'])
return $permissionModel::select(['permissions.id', 'permissions.slug', 'permission_role.created_at as pivot_created_at', 'permission_role.updated_at as pivot_updated_at'])
->join('permission_role', 'permission_role.permission_id', '=', 'permissions.id')->join('roles', 'roles.id', '=', 'permission_role.role_id')
->whereIn('roles.id', $this->getRoles()->lists('id')->toArray()) ->orWhere('roles.level', '<', $this->level())
->groupBy(['permissions.id', 'pivot_created_at', 'pivot_updated_at']);
->groupBy(['permissions.id', 'permissions.slug', 'permission_role.created_at', 'permission_role.updated_at']);
}

/**
Expand Down