fixing fractional bid issue
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user