Browse Source

fixed the worst error ive ever experienced

1day2die 3 years ago
parent
commit
ad8c8b5ebe

+ 3 - 3
app/Http/Controllers/Admin/PaymentController.php

@@ -185,7 +185,7 @@ class PaymentController extends Controller
                 if ($user->role == 'member') {
                     $user->update(['role' => 'client']);
 
-                    if((config("SETTINGS::REFERRAL:MODE") == "commission" || config("SETTINGS::REFERRAL:MODE" == "both")) && $shopProduct->type=="Credits"){
+                    if((config("SETTINGS::REFERRAL:MODE") == "commission" || config("SETTINGS::REFERRAL:MODE") == "both") && $shopProduct->type=="Credits"){
                         if($ref_user = DB::table("user_referrals")->where('registered_user_id', '=', $user->id)->first()){
                             $ref_user = User::findOrFail($ref_user->referral_id);
                             $increment = number_format($shopProduct->quantity/100*config("SETTINGS::REFERRAL:PERCENTAGE"),0,"","");
@@ -342,7 +342,7 @@ class PaymentController extends Controller
                 if ($user->role == 'member') {
                     $user->update(['role' => 'client']);
 
-                    if((config("SETTINGS::REFERRAL:MODE") == "commission"  || config("SETTINGS::REFERRAL:MODE" == "both")) && $shopProduct->type=="Credits"){
+                    if((config("SETTINGS::REFERRAL:MODE") == "commission"  || config("SETTINGS::REFERRAL:MODE") == "both") && $shopProduct->type=="Credits"){
                         if($ref_user = DB::table("user_referrals")->where('registered_user_id', '=', $user->id)->first()){
                             $ref_user = User::findOrFail($ref_user->referral_id);
                             $increment = number_format($shopProduct->quantity/100*config("SETTINGS::REFERRAL:PERCENTAGE"),0,"","");
@@ -457,7 +457,7 @@ class PaymentController extends Controller
                 if ($user->role == 'member') {
                     $user->update(['role' => 'client']);
 
-                    if((config("SETTINGS::REFERRAL:MODE") == "commission"  || config("SETTINGS::REFERRAL:MODE" == "both"))&& $shopProduct->type=="Credits"){
+                    if((config("SETTINGS::REFERRAL:MODE") == "commission"  || config("SETTINGS::REFERRAL:MODE") == "both")&& $shopProduct->type=="Credits"){
                         if($ref_user = DB::table("user_referrals")->where('registered_user_id', '=', $user->id)->first()){
                             $ref_user = User::findOrFail($ref_user->referral_id);
                             $increment = number_format($shopProduct->quantity/100*config("SETTINGS::REFERRAL:PERCENTAGE"),0,"","");

+ 1 - 1
app/Http/Controllers/Api/UserController.php

@@ -288,7 +288,7 @@ class UserController extends Controller
             $ref_code = $request->input("referral_code");
             $new_user = $user->id;
             if($ref_user = User::query()->where('referral_code', '=', $ref_code)->first()) {
-                if(config("SETTINGS::REFERRAL:MODE" == "sign-up") || config("SETTINGS::REFERRAL:MODE" == "both")) {
+                if(config("SETTINGS::REFERRAL:MODE") == "register" || config("SETTINGS::REFERRAL:MODE") == "both") {
                     $ref_user->increment('credits', config("SETTINGS::REFERRAL::REWARD"));
                     $ref_user->notify(new ReferralNotification($ref_user->id, $new_user));
                 }

+ 2 - 1
app/Http/Controllers/Auth/RegisterController.php

@@ -14,6 +14,7 @@ use Illuminate\Support\Facades\App;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Hash;
+use Illuminate\Support\Facades\Log;
 use Illuminate\Support\Facades\Validator;
 use Illuminate\Support\Str;
 use Illuminate\Validation\ValidationException;
@@ -139,7 +140,7 @@ class RegisterController extends Controller
             $ref_code = $data['referral_code'];
             $new_user = $user->id;
             if($ref_user = User::query()->where('referral_code', '=', $ref_code)->first()) {
-                if(config("SETTINGS::REFERRAL:MODE" == "sign-up") || config("SETTINGS::REFERRAL:MODE" == "both")) {
+                if(config("SETTINGS::REFERRAL:MODE") == "sign-up" || config("SETTINGS::REFERRAL:MODE") == "both") {
                     $ref_user->increment('credits', config("SETTINGS::REFERRAL::REWARD"));
                     $ref_user->notify(new ReferralNotification($ref_user->id, $new_user));
                 }