|
|
|
|
@@ -539,7 +539,7 @@ class MarketPlaceController extends Controller
|
|
|
|
|
'no_of_units_you_wish_to_buy' => $request->no_of_units_you_wish_to_buy,
|
|
|
|
|
'offer_price_per_unit' => $request->offer_price_per_unit,
|
|
|
|
|
// 'total_purchase_value' => $request->total_purchase_value,
|
|
|
|
|
'total_purchase_value' => $request->no_of_units_you_wish_to_buy * $request->offer_price_per_unit
|
|
|
|
|
'total_purchase_value' => ($request->no_of_units_you_wish_to_buy == 0 && $request->offer_price_per_unit == 0) ? $request->total_purchase_value : $request->no_of_units_you_wish_to_buy * $request->offer_price_per_unit,
|
|
|
|
|
]);
|
|
|
|
|
$user = ModelsUser::find($request->user()->id);
|
|
|
|
|
if ($buyerForm) {
|
|
|
|
|
@@ -605,7 +605,7 @@ class MarketPlaceController extends Controller
|
|
|
|
|
'no_of_units_you_wish_to_buy' => $request->no_of_units_you_wish_to_buy,
|
|
|
|
|
'offer_price_per_unit' => $request->offer_price_per_unit,
|
|
|
|
|
// 'total_purchase_value' => $request->total_purchase_value,
|
|
|
|
|
'total_purchase_value' => $request->no_of_units_you_wish_to_buy * $request->offer_price_per_unit
|
|
|
|
|
'total_purchase_value' => ($request->no_of_units_you_wish_to_buy == 0 && $request->offer_price_per_unit == 0) ? $request->total_purchase_value : $request->no_of_units_you_wish_to_buy * $request->offer_price_per_unit
|
|
|
|
|
]);
|
|
|
|
|
$user = ModelsUser::find($request->user()->id);
|
|
|
|
|
if ($buyerForm) {
|
|
|
|
|
@@ -631,7 +631,7 @@ class MarketPlaceController extends Controller
|
|
|
|
|
};
|
|
|
|
|
if (MarketplaceFractionalRealEstateSeller::where('slug', $slug)->exists()) {
|
|
|
|
|
$offering['type'] = 'fractional-real-estate';
|
|
|
|
|
$marketFRE = MarketplaceFractionalRealEstateSeller::where('slug', $slug)->first();
|
|
|
|
|
$marketFRE = MarketplaceFractionalRealEstateSeller::with('company')->where('slug', $slug)->first();
|
|
|
|
|
$offering['own-product'] = MarketplaceSellerForm::where(['id' => $marketFRE->seller_forms_id, 'users_id' => auth('sanctum')->id()])->exists();
|
|
|
|
|
$offering['data'] = $marketFRE;
|
|
|
|
|
// dd($marketFRE);
|
|
|
|
|
@@ -677,7 +677,7 @@ class MarketPlaceController extends Controller
|
|
|
|
|
{
|
|
|
|
|
$interestedStatus = false;
|
|
|
|
|
if (request()->user()) {
|
|
|
|
|
$interestedStatus = MarketplaceBuyerForm::where(['users_id' => request()->user()->id, 'table' => $table, 'associated_id' => $offering->id])->exists();
|
|
|
|
|
$interestedStatus = MarketplaceBuyerForm::where(['users_id' => request()->user()->id, 'table' => $table, 'associated_id' => $offering->id])->where('status','!=','Sold')->exists();
|
|
|
|
|
}
|
|
|
|
|
$totalInterestedBuyers = MarketplaceBuyerForm::where(['table' => $table, 'associated_id' => $offering->id])->count();
|
|
|
|
|
return [
|
|
|
|
|
|