From e595249ba7daf916faeaee011227b49d09ee50e6 Mon Sep 17 00:00:00 2001 From: gholak tala Date: Thu, 30 Apr 2026 15:36:04 +0000 Subject: [PATCH] NASER dynamic invite limit --- app/Http/Controllers/Customer/CustomerController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Customer/CustomerController.php b/app/Http/Controllers/Customer/CustomerController.php index fc23734..3c630f1 100644 --- a/app/Http/Controllers/Customer/CustomerController.php +++ b/app/Http/Controllers/Customer/CustomerController.php @@ -197,7 +197,10 @@ class CustomerController extends Controller $companyName = $this->Config('name_fa'); $companyurl = $this->Config('app_url'); $referrer = $customer->referral; - if (Customer::where('referral_to_id', $referrer->referral_id)->get()->count() <= $referrer->add_user_limit && $gift_for_inviter > 0) { + $total_referrals = Customer::where('referral_to_id', $referrer->referral_id)->where('is_legal', '!=', 0)->get()->count(); + $referral_limit = Setting::where('key', 'referral_limit')->first(); + $gift_permision = $referral_limit->active ? $total_referrals < $referral_limit->value ? true : false : true ; + if ($gift_permision && $gift_for_inviter > 0) { // dd($gift_for_inviter > 0, $gift_for_invited > 0); $Withdraw = Withdraw::create([