mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
add column for old or new customers in the customer excel export
This commit is contained in:
@@ -43,6 +43,7 @@ class ExportsCustomers implements FromQuery, WithHeadingRow, WithMapping
|
||||
*/
|
||||
public function map($company): array
|
||||
{
|
||||
|
||||
return [
|
||||
$company->reference,
|
||||
$company->name,
|
||||
@@ -50,9 +51,7 @@ class ExportsCustomers implements FromQuery, WithHeadingRow, WithMapping
|
||||
count($company->bookings),
|
||||
$company->bookings()->sum('fix_amount'),
|
||||
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($company->created_at),
|
||||
count($company->whereHas('segments', function($query){
|
||||
return $query->where('id', '=', 5);
|
||||
})->get())
|
||||
count($company->segments()->where('segment_id', '=', 5)->get()) ? 'Exchange 1.0' : 'Exchange 2.0'
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user