From c2c1a4d281259c6b3bbeff973fdb7f498e1ebb66 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 4 Oct 2021 01:57:43 +0200 Subject: [PATCH] Fixed admin free join query nesting --- includes/pages/admin_free.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php index 5c767c06..62bca659 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -57,9 +57,13 @@ function admin_free() $join->on('UserAngelTypes.user_id', '=', 'users.id') ->where('UserAngelTypes.angeltype_id', '=', $angelType); }); - $query->join('AngelTypes', 'UserAngelTypes.angeltype_id', 'AngelTypes.id') - ->whereNotNull('UserAngelTypes.confirm_user_id') - ->orWhere('AngelTypes.restricted', '=', '0'); + + $query->join('AngelTypes', function ($join) { + /** @var JoinClause $join */ + $join->on('UserAngelTypes.angeltype_id', '=', 'AngelTypes.id') + ->whereNotNull('UserAngelTypes.confirm_user_id') + ->orWhere('AngelTypes.restricted', '=', '0'); + }); } $users = $query->get();