From 834d25b66bfbdfa648b76e12c73c6449b2c517b3 Mon Sep 17 00:00:00 2001 From: oregami Date: Sun, 22 May 2016 16:37:44 +0800 Subject: [PATCH] fix query user --- core/server/models/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/models/user.js b/core/server/models/user.js index c7789a50f7..9c80c04073 100644 --- a/core/server/models/user.js +++ b/core/server/models/user.js @@ -276,7 +276,7 @@ User = ghostBookshelf.Model.extend({ query = this.forge(data, {include: options.include}); - query.query('join', 'roles_users', 'users.id', '=', 'roles_users.id'); + query.query('join', 'roles_users', 'users.id', '=', 'roles_users.user_id'); query.query('join', 'roles', 'roles_users.role_id', '=', 'roles.id'); query.query('where', 'roles.name', '=', lookupRole); } else {