diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php index 5809a97..cd4b550 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php @@ -43,7 +43,7 @@ class ManageFreeUInvestmentController extends Controller public function index() { $products = Product::query() - ->select(DB::raw('products.id, coalesce(sdi.product_name, p2p.scheme, fre.property_name_and_location,id.company_name,aif.fund_name,caga.project_name,hyf.security_name,lbf.company,sdi.product_name,vd.company_name) as product_name'), DB::raw('DATE_FORMAT(products.created_at, "%d-%b-%Y") as date'), 'categories.category_name', DB::raw('coalesce(sdi.minimum_investment, p2p.minimum_investment, fre.minimum_investment,id.minimum_investment,aif.minimum_investment,caga.minimum_investment,hyf.minimum_investment,lbf.minimum_investment,sdi.minimum_investment,vd.minimum_investment) as minimum_investment'), 'products.commission_type', 'products.rate', 'products.commission', 'products.description', 'products.top_pick', 'products.tables_id', 'products.status') + ->select(DB::raw('products.id, coalesce(sdi.product_name,re.property_name,funds.fund_name , p2p.scheme, fre.property_name_and_location,id.company_name,aif.fund_name,caga.project_name,hyf.security_name,lbf.company,sdi.product_name,vd.company_name) as product_name'), DB::raw('DATE_FORMAT(products.created_at, "%d-%b-%Y") as date'), 'categories.category_name', DB::raw('coalesce(sdi.minimum_investment, p2p.minimum_investment, fre.minimum_investment,id.minimum_investment,aif.minimum_investment,caga.minimum_investment,hyf.minimum_investment,lbf.minimum_investment,sdi.minimum_investment,vd.minimum_investment,re.total_price,funds.minimum_investment) as minimum_investment'), 'products.commission_type', 'products.rate', 'products.commission', 'products.description', 'products.top_pick', 'products.tables_id', 'products.status') ->leftJoin('securitized_debt_instruments as sdi', 'products.id', 'sdi.products_id') ->leftJoin('fractional_real_estates as fre', 'products.id', 'fre.products_id') ->leftJoin('peer_to_peer_lendings as p2p', 'products.id', 'p2p.products_id') @@ -53,7 +53,8 @@ class ManageFreeUInvestmentController extends Controller ->leftJoin('high_yield_finances as hyf', 'products.id', 'hyf.products_id') ->leftJoin('lease_based_financings as lbf', 'products.id', 'lbf.products_id') ->leftJoin('venture_debts as vd', 'products.id', 'vd.products_id') - // ->leftJoin('real_estates as re', 'products.id', 're.products_id') + ->leftJoin('real_estates as re', 'products.id', 're.products_id') + ->leftJoin('funds', 'products.id', 'funds.products_id') ->join('categories', 'products.categories_id', 'categories.id') ->latest('products.created_at') ->get(); diff --git a/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php b/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php index e6e13be..b624eff 100644 --- a/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php +++ b/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php @@ -501,6 +501,11 @@ class AlternativeInvestmentFundController extends Controller { $learnMore = (new FractionalRealEstateFrontendController)->pcfQuestionAndAnswer()->getData(); - return view('Frontend.Pages.private-credit-fund.index', ['learnMore' => $learnMore]); + return view('Frontend.Pages.private-credit-fund.index', [ + 'learnMore' => $learnMore, + // 'openFFDA' => $this->aif->openPCF()->getData(), + // 'fullyFundedFFDA' => $this->aif->fullyFundedFFDA()->getData(), + // 'resaleFFDA' => $this->aif->resaleFFDA()->getData(), + ]); } } diff --git a/app/Models/Product.php b/app/Models/Product.php index 1a250f3..7c7b6dd 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -179,6 +179,11 @@ class Product extends Model return $query->where(['tables_id' => 12, 'categories_id' => 28]); } + public function scopePrivateCreditFund($query) + { + return $query->where(['tables_id' => 12, 'categories_id' => 40]); + } + public function scopeInfrastructureFund($query) { return $query->where(['tables_id' => 12, 'categories_id' => 29]); diff --git a/app/Services/Frontend/AIFService.php b/app/Services/Frontend/AIFService.php index 4a0f1cc..86524f2 100644 --- a/app/Services/Frontend/AIFService.php +++ b/app/Services/Frontend/AIFService.php @@ -16,6 +16,10 @@ class AIFService{ } //Venture Capital Funds + public function openPCF() + { + return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateCreditFund()->open()->active()->latest()->get()); + } public function openVCF() { return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->ventureCapitalFund()->open()->active()->latest()->get()); diff --git a/app/View/Components/PrivateCreditfund.php b/app/View/Components/PrivateCreditfund.php new file mode 100644 index 0000000..ef23643 --- /dev/null +++ b/app/View/Components/PrivateCreditfund.php @@ -0,0 +1,28 @@ +