fixed api
This commit is contained in:
@@ -47,14 +47,14 @@ class DashboardController extends Controller
|
||||
$freInvestmentListed = $this->freInvestmentListed()['data'];
|
||||
$opInvestmentListed = $this->opInvestmentListed()['data'];
|
||||
//
|
||||
$marketPlaceAIFSellerData = $this->getMarketplaceAIFSellerData();
|
||||
$marketPlaceFRESellerData = $this->getMarketplaceFRESellerData();
|
||||
$marketPlaceAIFSellerData = $this->getMarketplaceAIFSellerData(1);
|
||||
$marketPlaceFRESellerData = $this->getMarketplaceFRESellerData(1);
|
||||
$marketPlaceOPSellerData = $this->getMarketplaceOPSellerData();
|
||||
$totalInvestmentTillDate = '₹ ' . $this->IND_money_format($currentInvestmentProduct['totalInvestmentInInt'] + $reedemedInvestmentProduct['totalInvestmentInInt']);
|
||||
return view('Frontend.Pages.profile.dashboard', compact('currentInvestmentProduct', 'reedemedInvestmentProduct', 'totalInvestmentTillDate', 'aifInvestmentWatchlist', 'freInvestmentWatchlist', 'opInvestmentWatchlist', 'aifSoldInvestmentWatchlist', 'freSoldInvestmentWatchlist', 'opSoldInvestmentWatchlist', 'user', 'aifInvestmentListed', 'freInvestmentListed', 'opInvestmentListed', 'marketPlaceAIFSellerData', 'marketPlaceFRESellerData', 'marketPlaceOPSellerData'));
|
||||
}
|
||||
|
||||
public function getMarketplaceAIFSellerData()
|
||||
public function getMarketplaceAIFSellerData($api = null)
|
||||
{
|
||||
$id = auth()->guard('users')->user()->id ?? request()->user()->id;
|
||||
// $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_aif_sellers'])->get();
|
||||
@@ -66,9 +66,16 @@ class DashboardController extends Controller
|
||||
$sellerData = MarketplaceSellerForm::with('aif')->where('users_id',$id)->get();
|
||||
// dd($sellerData);
|
||||
// return $sellerData[0]->aif['name_of_the_aif_fund'];
|
||||
// return $api;
|
||||
if($api == null)
|
||||
{
|
||||
$data['data'] = $sellerData;
|
||||
return $data;
|
||||
}
|
||||
if(count($sellerData->toArray()))
|
||||
{
|
||||
$market_place_data = $sellerData[0]->aif->toArray();
|
||||
// dd($market_place_data);
|
||||
return $market_place_data;
|
||||
}
|
||||
return $sellerData;
|
||||
@@ -111,7 +118,7 @@ class DashboardController extends Controller
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getMarketplaceFRESellerData()
|
||||
public function getMarketplaceFRESellerData($api = null)
|
||||
{
|
||||
$id = auth()->guard('users')->user()->id ?? request()->user()->id;
|
||||
// $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_fre_sellers'])->get();
|
||||
@@ -121,6 +128,11 @@ class DashboardController extends Controller
|
||||
// return $market_place_data;
|
||||
$sellerData = MarketplaceSellerForm::with('fre')->where('users_id',$id)->get();
|
||||
// dd(count($sellerData->toArray()));
|
||||
if($api == null)
|
||||
{
|
||||
$data['data'] = $sellerData;
|
||||
return $data;
|
||||
}
|
||||
if(count($sellerData->toArray()))
|
||||
{
|
||||
$market_place_data = $sellerData[0]->fre->toArray();
|
||||
|
||||
@@ -28,8 +28,8 @@ class AngelFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null,
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'registration_number' => $this->registration_number,
|
||||
|
||||
@@ -29,8 +29,8 @@ class FractionalRealEstateResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
|
||||
'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null,
|
||||
'companies_id' => $this->companies_id,
|
||||
'slug' => $this->slug,
|
||||
'property_name_and_location' => $this->property_name_and_location,
|
||||
|
||||
@@ -28,8 +28,8 @@ class FundForDistressedAssetResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null,
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'isin_code' => $this->isin_code,
|
||||
|
||||
@@ -19,8 +19,8 @@ class GlobalBondResource extends JsonResource
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'presentation' => Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null,
|
||||
'slug' => $this->slug,
|
||||
'issuer' => $this->issuer,
|
||||
'type' => $this->type,
|
||||
|
||||
@@ -18,8 +18,8 @@ class GlobalEquityStockRealEstateResource extends JsonResource
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'presentation' => Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null,
|
||||
'name' => $this->name,
|
||||
'type' => $this->type,
|
||||
'slug' => $this->slug,
|
||||
|
||||
@@ -29,8 +29,8 @@ class GlobalFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
|
||||
'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null,
|
||||
'slug' => $this->slug,
|
||||
'issuer' => $this->issuer,
|
||||
'fund_name' => $this->fund_name,
|
||||
|
||||
@@ -29,8 +29,8 @@ class HedgeFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
|
||||
'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null,
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'registration_number' => $this->registration_number,
|
||||
|
||||
@@ -28,8 +28,8 @@ class InfrastructureFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) == null ? null : Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id) == null ? null : Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('fact_sheet'),
|
||||
'fund_name' => $this->fund_name ?? '',
|
||||
'slug' => $this->slug ?? '',
|
||||
'isin_code' => $this->isin_code ?? '',
|
||||
|
||||
@@ -25,12 +25,14 @@ class LongOnlyEquityResource extends JsonResource
|
||||
}
|
||||
|
||||
}
|
||||
// $presentationFile = Product::where('id',$this->products_id)->value('presentation');
|
||||
// dd($presentationFile,$this->products_id);
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
|
||||
'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null,
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'registration_number' => $this->registration_number,
|
||||
|
||||
@@ -28,8 +28,8 @@ class PrivateEquityFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' =>Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
|
||||
'presentation' =>Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null,
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'registration_number' => $this->registration_number,
|
||||
|
||||
@@ -28,8 +28,8 @@ class PrivateInvestmentInPublicEquityFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
|
||||
'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null,
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'registration_number' => $this->registration_number,
|
||||
|
||||
@@ -29,8 +29,8 @@ class PrivateRealEstateFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) == false ? null : Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id) == false ? null : Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('fact_sheet'),
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'registration_number' => $this->registration_number,
|
||||
|
||||
@@ -19,8 +19,8 @@ class RealEstateResource extends JsonResource
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'presentation' => Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null,
|
||||
'property_name' => $this->property_name,
|
||||
'slug' => $this->slug,
|
||||
'property_location' => $this->property_location,
|
||||
|
||||
@@ -28,8 +28,8 @@ class VentureCapitalFundResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
|
||||
'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null,
|
||||
'fund_name' => $this->fund_name,
|
||||
'slug' => $this->slug,
|
||||
'registration_number' => $this->registration_number,
|
||||
|
||||
@@ -30,8 +30,8 @@ class VentureDebtResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'products_id' => $this->products_id,
|
||||
'product_images' => $imagePaths,
|
||||
'presentation' => Product::find($this->products_id)->value('presentation'),
|
||||
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
|
||||
'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null,
|
||||
'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null,
|
||||
'company_name' => $this->company_name,
|
||||
'slug' => $this->slug,
|
||||
'sector' => $this->sector,
|
||||
|
||||
Reference in New Issue
Block a user