From fbb6298fb263286a4194e730e2c7d63209cbe7d2 Mon Sep 17 00:00:00 2001 From: MalMen Date: Mon, 25 Apr 2016 03:52:45 +0100 Subject: [PATCH] MSSQL fix Fix permition check query for mssql --- src/Bican/Roles/Traits/HasRoleAndPermission.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bican/Roles/Traits/HasRoleAndPermission.php b/src/Bican/Roles/Traits/HasRoleAndPermission.php index 840cc1c..325a6af 100644 --- a/src/Bican/Roles/Traits/HasRoleAndPermission.php +++ b/src/Bican/Roles/Traits/HasRoleAndPermission.php @@ -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']); } /**