added log and exceptions
This commit is contained in:
@@ -29,6 +29,7 @@ use Cviebrock\EloquentSluggable\Services\SlugService;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use DB;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
@@ -65,29 +66,35 @@ class DashboardController extends Controller
|
||||
|
||||
public function getMarketplaceAIFSellerData($api = null)
|
||||
{
|
||||
$id = auth()->guard('users')->user()->id ?? request()->user()->id;
|
||||
// $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_aif_sellers'])->get();
|
||||
// foreach ($market_place_data as $row) {
|
||||
// $row['marketplace_aif_sellers_data'] = MarketplaceAlternativeInvestmentFundSeller::where('id', $row->associated_id)->first();
|
||||
// }
|
||||
// return $market_place_data;
|
||||
// $sellerData = MarketplaceSellerForm::has('aif')->with('aif')->where('users_id',$id)->get();
|
||||
$sellerData = MarketplaceSellerForm::with('aif')->where('users_id',$id)->get();
|
||||
// dd($sellerData);
|
||||
// return $sellerData[0]->aif['name_of_the_aif_fund'];
|
||||
// return $api;
|
||||
if($api == null)
|
||||
try{
|
||||
$id = auth()->guard('users')->user()->id ?? request()->user()->id;
|
||||
// $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_aif_sellers'])->get();
|
||||
// foreach ($market_place_data as $row) {
|
||||
// $row['marketplace_aif_sellers_data'] = MarketplaceAlternativeInvestmentFundSeller::where('id', $row->associated_id)->first();
|
||||
// }
|
||||
// return $market_place_data;
|
||||
// $sellerData = MarketplaceSellerForm::has('aif')->with('aif')->where('users_id',$id)->get();
|
||||
$sellerData = MarketplaceSellerForm::with('aif')->where('users_id',$id)->get();
|
||||
// dd($sellerData);
|
||||
// return $sellerData[0]->aif['name_of_the_aif_fund'];
|
||||
// return $api;
|
||||
if($api == null)
|
||||
{
|
||||
$data['data'] = $sellerData;
|
||||
return $data;
|
||||
}
|
||||
if(count($sellerData->toArray()))
|
||||
{
|
||||
$market_place_data = $sellerData[0]->aif->toArray();
|
||||
// dd($market_place_data);
|
||||
return $market_place_data;
|
||||
}
|
||||
return $sellerData;
|
||||
}catch(\Exception $e)
|
||||
{
|
||||
$data['data'] = $sellerData;
|
||||
return $data;
|
||||
Log::error("Something went wrong while fetching aif sold investment - ". $e->getMessage() . " on ". $e->getLine())
|
||||
// Log::error("Something went wrong while investment-". $e->getMessage() ." " .$e->getLine());
|
||||
}
|
||||
if(count($sellerData->toArray()))
|
||||
{
|
||||
$market_place_data = $sellerData[0]->aif->toArray();
|
||||
// dd($market_place_data);
|
||||
return $market_place_data;
|
||||
}
|
||||
return $sellerData;
|
||||
|
||||
}
|
||||
|
||||
@@ -187,14 +194,20 @@ class DashboardController extends Controller
|
||||
|
||||
public function viewInvestmentDetails()
|
||||
{
|
||||
$currentInvestmentProduct = $this->view_investors_details('Holding');
|
||||
$reedemedInvestmentProduct = $this->view_investors_details('Reedemed');
|
||||
$totalInvestmentTillDate = '₹ ' . $this->IND_money_format($currentInvestmentProduct['totalInvestmentInInt'] + $reedemedInvestmentProduct['totalInvestmentInInt']);
|
||||
return [
|
||||
'currentInvestmentProduct' => $currentInvestmentProduct,
|
||||
'reedemedInvestmentProduct' => $reedemedInvestmentProduct,
|
||||
'totalInvestmentTillDate' => $totalInvestmentTillDate,
|
||||
];
|
||||
try{
|
||||
|
||||
$currentInvestmentProduct = $this->view_investors_details('Holding');
|
||||
$reedemedInvestmentProduct = $this->view_investors_details('Reedemed');
|
||||
$totalInvestmentTillDate = '₹ ' . $this->IND_money_format($currentInvestmentProduct['totalInvestmentInInt'] + $reedemedInvestmentProduct['totalInvestmentInInt']);
|
||||
return [
|
||||
'currentInvestmentProduct' => $currentInvestmentProduct,
|
||||
'reedemedInvestmentProduct' => $reedemedInvestmentProduct,
|
||||
'totalInvestmentTillDate' => $totalInvestmentTillDate,
|
||||
];
|
||||
}catch(\Exception $e)
|
||||
{
|
||||
Log::error("Something went wrong while investment-". $e->getMessage() ." " .$e->getLine());
|
||||
}
|
||||
}
|
||||
|
||||
public function investmentSummary()
|
||||
|
||||
Reference in New Issue
Block a user