Merge pull request #184 from Ritikeshyadav/RitikeshFreeu
Ritikesh freeu
This commit is contained in:
@@ -36,6 +36,7 @@ use App\Models\LeaseBasedFinancing;
|
||||
use App\Models\SecuritizedDebtInstrument;
|
||||
use App\Models\StockFundsRealEstateExchange;
|
||||
use App\Models\AlternativeInvestmentFund;
|
||||
use App\Models\MonthlyUpdateMaster;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\ProductPhotoDocuments;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
@@ -76,6 +77,14 @@ class ManageFreeUInvestmentController extends Controller
|
||||
public function productDelete(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
|
||||
$exists = MonthlyUpdateMaster::where('products_id',$request->id)->where('holding_status','Holding')->exists();
|
||||
if($exists)
|
||||
{
|
||||
return response(['status' => 400, 'message' => 'You can not delete this product because some investor has holding this product']);
|
||||
}
|
||||
// dd('hello');
|
||||
|
||||
$product = Product::where('id', $request->id)->delete();
|
||||
// $FREProduct = FractionalRealEstate::where('products_id',$request->id)->first();
|
||||
if (FractionalRealEstate::where('products_id', $request->id)->exists()) {
|
||||
|
||||
@@ -385,10 +385,11 @@ class DashboardController extends Controller
|
||||
public function getProductDetail(Request $request)
|
||||
{
|
||||
$id = $request->id;
|
||||
// dd($id);
|
||||
if($id)
|
||||
{
|
||||
$product_id = MonthlyUpdateMaster::where('id',$id)->value('products_id');
|
||||
// dd($product_id);
|
||||
// dd(FractionalRealEstate::where('products_id',$product_id)->exists());
|
||||
if(AlternativeInvestmentFund::where('products_id',$product_id)->exists())
|
||||
{
|
||||
$data = Product::with('alternativeInvestmentFund','categorys')->where('id',$product_id)->first();
|
||||
|
||||
@@ -615,6 +615,8 @@ class MarketPlaceController extends Controller
|
||||
$marketFRE = MarketplaceFractionalRealEstateSeller::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);
|
||||
|
||||
|
||||
$offering['invested'] = $this->checkInvestmentInterestedAPI($offering['data'], 'marketplace_fre_sellers')['interested-status'];
|
||||
$offering['invested-data'] = $this->checkInvestmentInterestedDataAPI($offering['data'], 'marketplace_fre_sellers')['interested-status-data']; //new added
|
||||
|
||||
@@ -44,8 +44,8 @@ class MarketplaceBuyerForm extends Model
|
||||
}
|
||||
|
||||
public function getFundCategoryAttribute($value){
|
||||
// return 123;
|
||||
return $this->attributes['name_of_the_aif_fund'];
|
||||
return $value;
|
||||
// return $this->attributes['name_of_the_aif_fund'];
|
||||
|
||||
// return $this->get_money_format($value);
|
||||
}
|
||||
|
||||
@@ -479,6 +479,42 @@
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Delete Modals-->
|
||||
{{-- blocked_modal start --}}
|
||||
<div class="modal fade invest-modal-pop" id="messagePopup" data-bs-backdrop="static" data-bs-keyboard="false"
|
||||
tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-body pb-5">
|
||||
|
||||
<div class="invest-modal">
|
||||
|
||||
{{-- <img src="{{ asset('public/assets/media/FrontendImages/thumbs-up.png') }}"> --}}
|
||||
|
||||
<h2 id="modal_message"></h2>
|
||||
|
||||
{{-- <p>A Advisory Team Will get back to you soon.</p> --}}
|
||||
|
||||
{{-- <a href="{{ route('accounts') }}">Complete KYC</a> --}}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{-- blocked_modal end --}}
|
||||
@endsection
|
||||
@section('scripts')
|
||||
|
||||
@@ -502,13 +538,18 @@ $('#productDeleteBtn').click(function() {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
},
|
||||
success: function(result) {
|
||||
$('#productDeleteModal').modal('hide');
|
||||
if (result.status == 200) {
|
||||
$('#productDeleteModal').modal('hide');
|
||||
toastr.success(result.message);
|
||||
setTimeout(function() {
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
} else if(result.status == 400){
|
||||
$('#modal_message').html(result.message);
|
||||
$('#messagePopup').modal('show');
|
||||
}
|
||||
else {
|
||||
toastr.warning(result.message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user