solving Bugs

This commit is contained in:
cj201199
2024-04-25 11:41:33 +05:30
108 changed files with 9182 additions and 8617 deletions

View File

@@ -16,6 +16,8 @@ use Illuminate\Support\Facades\Validator;
use App\Models\MarketplaceOtherProductsSeller;
use App\Models\MarketplaceFractionalRealEstateSeller;
use App\Models\MarketplaceAlternativeInvestmentFundSeller;
use App\Exports\InvestmentExport;
use Excel;
class OverviewController extends Controller
{
@@ -32,7 +34,82 @@ class OverviewController extends Controller
$freMarketPlace = MarketplaceFractionalRealEstateSeller::where('status', 'Approved')->latest()->get();
// dd($freMarketPlace);
$opMarketPlace = MarketplaceOtherProductsSeller::where('status', 'Approved')->latest()->get();
return view('Admin.Pages.pre_owned_investment.pre_owned_investment', compact('aifMarketPlace', 'freMarketPlace', 'opMarketPlace', 'totalSellerProfile', 'completedTransactions', 'totalInvestmentListed'));
$allMarketPlace = collect();
foreach($aifMarketPlace as $data)
{
$data->table = 'marketplace_aif_sellers';
$allMarketPlace->push($data);
}
foreach($freMarketPlace as $data)
{
$data->table = 'marketplace_fre_sellers';
$allMarketPlace->push($data);
}
$allMarketPlace = $allMarketPlace->sortByDesc('created_at');
// dd($allMarketPlace);
return view('Admin.Pages.pre_owned_investment.pre_owned_investment', compact('aifMarketPlace', 'freMarketPlace', 'opMarketPlace', 'totalSellerProfile', 'completedTransactions', 'totalInvestmentListed','allMarketPlace'));
}
public function downloadInvestment()
{
// $aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::with(['seller' => function($query){$query->select('name as SellerName','email as Email','contact_number as Contact')->get();}])->where('status', 'Approved')->latest()->select('name_of_the_aif_fund as Product','expected_sale_per_unit as ExpectedSellingPrice','listing_status as ListingStatus')->get();
$aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::with('seller')->where('status', 'Approved')->latest()->get();
$freMarketPlace = MarketplaceFractionalRealEstateSeller::with('seller')->where('status', 'Approved')->latest()->get();
// $aifMarketPlace = MarketplaceAlternativeInvestmentFundSeller::with('seller')->where('status', 'Approved')->latest()->get();
// $freMarketPlace = MarketplaceFractionalRealEstateSeller::with('seller')->where('status', 'Approved')->latest()->get();
$allMarketPlace = collect();
$newData = [];
$count = 0;
foreach($aifMarketPlace as $data)
{
// $data['table'] = 'marketplace_aif_sellers';
// $newData[$count]['Product'] = $data->name_of_the_aif_fund;
// $newData[$count]['ExpectedSellingPrice'] = $data->expected_sale_per_unit ;
// $newData[$count]['SellerName'] = $data->seller->name;
// $newData[$count]['Email'] = $data->seller->email;
// $newData[$count]['Contact'] = $data->seller->contact_number;
// $newData[$count]['ListingStatus'] = $data->listing_status;
// $newData[$count]['CreatedAt'] = $data->created_at->format('F d, o');
$newData = array(
"Product" => $data->name_of_the_aif_fund,
"ExpectedSellingPrice" => $data->expected_sale_per_unit,
"SellerName" => $data->seller->name,
"Email" => $data->seller->email,
"Contact" => $data->seller->contact_number,
"ListingStatus" => $data->listing_status,
"CreatedAt" => $data->created_at->format('F d, o')
);
$allMarketPlace->push($newData);
$count++;
}
foreach($freMarketPlace as $data)
{
// $newData[$count]['Product'] = $data->property_name;
// $newData[$count]['ExpectedSellingPrice'] = $data->expected_selling_price ;
// $newData[$count]['SellerName'] = $data->seller->name;
// $newData[$count]['Email'] = $data->seller->email;
// $newData[$count]['Contact'] = $data->seller->contact_number;
// $newData[$count]['ListingStatus'] = $data->listing_status;
// $newData[$count]['CreatedAt'] = $data->created_at->format('F d, o');
$newData = array(
"Product" => $data->property_name,
"ExpectedSellingPrice" => $data->expected_selling_price ,
"SellerName" => $data->seller->name,
"Email" => $data->seller->email,
"Contact" => $data->seller->contact_number,
"ListingStatus" => $data->listing_status,
"CreatedAt" => $data->created_at->format('F d, o')
);
$allMarketPlace->push($newData);
$count++;
}
// dd($allMarketPlace->sortByDesc('created_at'));
// return $allMarketPlace->sortByDesc('created_at');
// dd($allMarketPlace);
return Excel::download(new InvestmentExport($allMarketPlace), 'investmentExport.xlsx');
}
public function interestedBuyers($id, $table)