diff --git a/app/Models/MarketplaceAlternativeInvestmentFundSeller.php b/app/Models/MarketplaceAlternativeInvestmentFundSeller.php index 140f1d1..0b8c46b 100644 --- a/app/Models/MarketplaceAlternativeInvestmentFundSeller.php +++ b/app/Models/MarketplaceAlternativeInvestmentFundSeller.php @@ -126,8 +126,8 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model public function getBidAttribute($id) { - $values = MarketplaceAlternativeInvestmentFundSeller::where('id', $id)->first(); - // dd($id); + $values = MarketplaceAlternativeInvestmentFundSeller::where('id', $this->id)->first(); + // dd("values",$values); $bids = MarketplaceBuyerForm::where(['associated_id' => $this->id, 'table' => 'marketplace_aif_sellers'])->where('status','!=','Sold')->get(); // $bids = MarketplaceBuyerForm::where(['associated_id' => $this->id, 'table' => 'marketplace_aif_sellers'])->get(); // dd($bids); @@ -141,10 +141,18 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model $bidArray->push($value->getAttributes()['total_purchase_value']); } }); - $nav = $values->no_of_units_held * $values->current_or_latest_nav; + +// dd($values); + $noOfUnitHeld = $values->current_or_latest_nav; + // dd( $noOfUnitHeld, intval($values->no_of_units_held) * intval($values->current_or_latest_nav)); + $nav = intval($noOfUnitHeld) * intval($values->current_or_latest_nav); // $highestBid = intval($bids[0]->bidMaxValue); + + $highestBid = intval($bidArray->max()); - $bid = ($highestBid - (int)$nav)/(int)$nav * 100 ; + + // dd($nav,$highestBid, ($highestBid - $nav)/(int)$nav * 100, count($bids)); + $bid = ($highestBid - $nav)/(int)$nav * 100 ; if(count($bids)) { return round($bid,3); @@ -157,6 +165,6 @@ class MarketplaceAlternativeInvestmentFundSeller extends Model // if ($bidArr) { // return (string)max($bidArr); // } - return (string)0; + return (int)0; } } diff --git a/app/helper.php b/app/helper.php index 9db5ea3..0923007 100644 --- a/app/helper.php +++ b/app/helper.php @@ -394,6 +394,11 @@ function getCategoryIcons($categoryId) "public/assets/media/FrontendImages/resi-real-state.svg" => Category::GlobalResidentialRealEstateID, "public/assets/media/FrontendImages/comm-real-state.svg" => Category::GlobalCommercialRealEstateID, ]; + + if ($categoryId === Category::PrivateEquityFundId) { + return "public/assets/media/FrontendImages/equity-funds.svg"; + } $condition = array_search($categoryId, $category_icons); + // return $condition; return $condition == true ? $condition : 'public/assets/media/FrontendImages/bay-arrow.svg'; } diff --git a/resources/views/Frontend/Pages/index.blade.php b/resources/views/Frontend/Pages/index.blade.php index ab42884..131269d 100644 --- a/resources/views/Frontend/Pages/index.blade.php +++ b/resources/views/Frontend/Pages/index.blade.php @@ -262,7 +262,7 @@ @if(count($topPicks['data'])) - {{-- @dd($topPicks['data']) --}} +