From 5d288cd07078f9fbfc873f22af47e146b1601775 Mon Sep 17 00:00:00 2001 From: 1day2die Date: Wed, 3 May 2023 16:05:55 +0200 Subject: [PATCH] Update UserPayment.php --- app/Listeners/UserPayment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Listeners/UserPayment.php b/app/Listeners/UserPayment.php index 4fbe9ba8..3417a7ce 100644 --- a/app/Listeners/UserPayment.php +++ b/app/Listeners/UserPayment.php @@ -35,7 +35,7 @@ class UserPayment $this->referral_always_give_commission = $referral_settings->always_give_commission; $this->credits_display_name = $general_settings->credits_display_name; } - + /** * Handle the event. * @@ -79,8 +79,8 @@ class UserPayment } } //update role give Referral-reward - if ($user->role == 'member') { - $user->update(['role' => 'client']); + if ($user->hasRole(4)) { + $user->syncRoles(3); //give referral commission only on first purchase if (($this->referral_mode === "commission" || $this->referral_mode === "both") && $shopProduct->type == "Credits" && !$this->referral_always_give_commission) {