This commit is contained in:
meghamalore
2024-05-06 16:42:05 +05:30
3 changed files with 19 additions and 6 deletions

View File

@@ -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;
}
}

View File

@@ -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';
}

View File

@@ -262,7 +262,7 @@
</div>
@if(count($topPicks['data']))
{{-- @dd($topPicks['data']) --}}
<div class="popular-assets">
<div class="container">
<div class="bg-brown-head mb-5">