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