diff --git a/app/Http/Controllers/Admin/ManageUserProductController.php b/app/Http/Controllers/Admin/ManageUserProductController.php index 9fc9a3b..016a708 100644 --- a/app/Http/Controllers/Admin/ManageUserProductController.php +++ b/app/Http/Controllers/Admin/ManageUserProductController.php @@ -130,7 +130,8 @@ class ManageUserProductController extends Controller // $hyfProductNames = $this->getAllProductNames(Category::HighYieldFinanceId); // $sdiProductNames = $this->getAllProductNames(Category::SecuritizedDebtInstrumentId); // $idProductNames = $this->getAllProductNames(Category::InvoiceDiscountingId); - $companies = Company::active()->get(); + + // making unique custom id $count = MonthlyUpdateMaster::get()->count(); @@ -144,11 +145,24 @@ class ManageUserProductController extends Controller } $customID .= $count; // dd($customID); + $companies = Company::active()->get(); // return view('Admin.Pages.manage_investors..manage_user_product.manage_user_add', compact('users','aifProductNames','freProductNames','p2pProductNames','ifaProductNames','lbfProductNames','cagaProductNames','vdProductNames','hyfProductNames','sdiProductNames','idProductNames','companies')); return view('Admin.Pages.manage_investors.manage_user_product.manage_user_add', compact('users', 'aifProductNames', 'freProductNames', 'companies','customID')); } + public function userProduct(Request $request){ + $data = Product::with('alternativeInvestmentFund.companies','categorys')->where('id',$request->id)->first(); + // dd($data); + if($data->alternativeInvestmentFund != null){ + return response()->json(['status'=>200,'category'=>'aif','data'=>$data]); + } + $data = Product::with('fractional_real_estate','categorys')->where('id',$request->id)->first(); + if($data->fractional_real_estate != null){ + return response()->json(['status'=>200,'category'=>'fre','data'=>$data]); + } + } + function getAllProductNames($categoriesId) { return Product:: diff --git a/app/Http/Controllers/Frontend/DashboardController.php b/app/Http/Controllers/Frontend/DashboardController.php index 06f5ae5..a0be52b 100644 --- a/app/Http/Controllers/Frontend/DashboardController.php +++ b/app/Http/Controllers/Frontend/DashboardController.php @@ -33,6 +33,7 @@ class DashboardController extends Controller { $user = $this->getUser()->data; $currentInvestmentProduct = $this->view_investors_details('Holding'); + // dd($currentInvestmentProduct); $reedemedInvestmentProduct = $this->view_investors_details('Reedemed'); // investment on watchlist @@ -363,13 +364,13 @@ class DashboardController extends Controller } $dataArr = [ 'id' => $singleMUM->id, - 'company_logo' => Company::find($singleMUM->investment_platform)->value('company_logo'), + 'company_logo' => Company::where('id',$singleMUM->investment_platform)->value('company_logo'), 'custom_id' => $singleMUM->custom_id, 'categories' => $categories, 'product_category' => $singleMUM->product_category, 'product_name' => $singleMUM->product_name, 'date_of_investment' => $singleMUM->created_at->format('d/m/y'), - 'company_name' => Company::find($singleMUM->investment_platform)->value('company_name'), + 'company_name' => Company::where('id',$singleMUM->investment_platform)->value('company_name'), 'route_id' => \Crypt::encrypt($singleMUM->custom_id) ]; $dataArr['total_investment_amount'] = $amount; @@ -387,7 +388,7 @@ class DashboardController extends Controller } $dataArr = [ // 'id' => $singleMUM->id, - 'company_logo' => Company::find($singleMUM->investment_platform)->value('company_logo'), + 'company_logo' => Company::where('id',$singleMUM->investment_platform)->value('company_logo'), 'custom_id' => $singleMUM->custom_id, 'categories' => $singleMUM->categories, // 'product_category' => $singleMUM->product_category, @@ -405,6 +406,7 @@ class DashboardController extends Controller { // $customId = Crypt::decrypt($customId); $data = $this->getInvestmentDetails($customId); + // dd($data); return view('Frontend.Pages.profile.investment-details.index', compact('data')); } @@ -413,9 +415,10 @@ class DashboardController extends Controller $data = array(); $customId = Crypt::decrypt($customId); $monthlyUpdateMaster = MonthlyUpdateMaster::where('custom_id', $customId)->firstOrFail(); + // dd($monthlyUpdateMaster); $data['basic-details'] = $monthlyUpdateMaster; - $data['company_name'] = Company::find($monthlyUpdateMaster->investment_platform)->value('company_name'); - $data['company_logo'] = Company::find($monthlyUpdateMaster->investment_platform)->value('company_logo'); + $data['company_name'] = Company::where('id',$monthlyUpdateMaster->investment_platform)->value('company_name'); + $data['company_logo'] = Company::where('id',$monthlyUpdateMaster->investment_platform)->value('company_logo'); if (MonthlyUpdateAlternativeInvestmentFund::where('custom_id', $customId)->exists()) { $data['category'] = 'Alternative Investment Fund'; $data['data'] = MonthlyUpdateAlternativeInvestmentFund::where(['custom_id' => $customId, 'status' => true])->latest()->first(); diff --git a/app/Http/Controllers/Frontend/MarketPlaceController.php b/app/Http/Controllers/Frontend/MarketPlaceController.php index 1aeaf23..4ad52f1 100644 --- a/app/Http/Controllers/Frontend/MarketPlaceController.php +++ b/app/Http/Controllers/Frontend/MarketPlaceController.php @@ -248,12 +248,13 @@ class MarketPlaceController extends Controller $id = $offering['data']->id; $userData = array(); $user = ModelsUser::find(auth()->guard('users')->user()->id); + $dataOfBuyerForm = MarketplaceBuyerForm::first(); $userData = (object)[ 'name' => $user->name ?? null, 'contact_number' => $user->contact_number ?? null, 'email' => $user->email ?? $user->email, ]; - return view('Frontend.Pages.profile.market-list.buyer-form', compact('table', 'id', 'userData')); + return view('Frontend.Pages.profile.market-list.buyer-form', compact('table', 'id', 'userData','dataOfBuyerForm')); } //editBuyerForm start by hritik on 5-4-2024 diff --git a/app/Models/Product.php b/app/Models/Product.php index 9bdb023..7b98743 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -110,6 +110,14 @@ class Product extends Model return $this->hasOne(Category::class, 'id', 'categories_id'); } + // public function aif(){ + // return $this->hasOne(AlternativeInvestmentFund::class,'id', 'products_id'); + // } + + public function companies(){ + return $this->belongsTo(Company::class,'companies_id',); + } + public function scopeFractionalRealEstate($query) { return $query->where('tables_id', 1); diff --git a/app/helper.php b/app/helper.php index 6d73000..c51d7ea 100644 --- a/app/helper.php +++ b/app/helper.php @@ -51,7 +51,7 @@ function imagePath($path = null) $finalPath = "https://staging.jerichoalternatives.in/"; } if (env('APP_ENV') == 'local') { - $finalPath = "http://localhost/freeu/my-freeu/"; + $finalPath = "http://localhost/my-freeu/"; } return $finalPath . $path; } diff --git a/resources/views/Admin/Pages/manage_investors/manage_user_product/manage_user_add.blade.php b/resources/views/Admin/Pages/manage_investors/manage_user_product/manage_user_add.blade.php index ea9fbcc..b0aa1c9 100644 --- a/resources/views/Admin/Pages/manage_investors/manage_user_product/manage_user_add.blade.php +++ b/resources/views/Admin/Pages/manage_investors/manage_user_product/manage_user_add.blade.php @@ -69,14 +69,14 @@ Investor Name - +