fixing fractional bid issue

This commit is contained in:
Ritikesh yadav
2024-05-07 17:26:06 +05:30
parent 2c56ec64f1
commit f2adb3c2ec
2 changed files with 20 additions and 14 deletions

View File

@@ -233,17 +233,22 @@ class OverviewController extends Controller
$getFREData = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->first();
$freValue = (int)$getFREData->current_market_value_of_the_property;
$nowValue = $freValue - $getBuyingPurchaseValue;
// $nowValue = -10;
// dd($freValue,' - ',$getBuyingPurchaseValue,' = ',$nowValue);
// dd($nowValue < 0 ? 'negative '.$nowValue : 'positive '.$nowValue);
$percentage = ($freValue - $getBuyingPurchaseValue) / $freValue * 100;
$expectedSellingPrice = (int)$getFREData->expected_selling_price;
$updateExpectedSellingPrice = $expectedSellingPrice * ($percentage / 100);
// dd($percentage,$updateExpectedSellingPrice);
if($nowValue <= 0)
{
$updatePrice = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->update([
'current_market_value_of_the_property' => 0,
'expected_selling_price' => 0,
]);
}else if($nowValue > 0){
$updatePrice = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->update([
'current_market_value_of_the_property' => $nowValue,
'expected_selling_price' => $updateExpectedSellingPrice,
]);
}
// else{