Skip to content

Commit

Permalink
bug: umiAuth wrong user table name
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyu65 committed Aug 19, 2017
1 parent 1f066e0 commit 5bdf6e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/umiAuth/src/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class User extends Model
{
protected $table = 'umi_users';
protected $table = 'users';

private $userPermsTable;
private $modelNameSpace = 'YM\umiAuth\src\Models';
Expand All @@ -26,8 +26,8 @@ private function permissionTable($user_id)
{
$minutes = Config::get('umiAuth.cache_minutes');
$callback = function () use ($user_id) {
return DB::table('umi_users')
->join('umi_user_role', 'umi_users.id', 'umi_user_role.user_id')
return DB::table('users')
->join('umi_user_role', 'users.id', 'umi_user_role.user_id')
->join('umi_roles', 'umi_user_role.role_id', 'umi_roles.id')
->join('umi_permission_role', 'umi_permission_role.role_id', 'umi_roles.id')
->join('umi_permissions', 'umi_permissions.id', 'umi_permission_role.permission_id')
Expand All @@ -42,7 +42,7 @@ private function permissionTable($user_id)
'umi_permission_role.role_id',
'umi_tables.table_name'
)
->where('umi_users.id', $user_id)
->where('users.id', $user_id)
->get();
};
return Cache::remember('userPerms', $minutes, $callback);
Expand Down

0 comments on commit 5bdf6e0

Please sign in to comment.