mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 17:03:59 +00:00
add /export/all-customers-info-for-lark-system
This commit is contained in:
@@ -24,6 +24,7 @@ use App\Classes\Modules\Exports\Services\ExportsImportedReceiptMappeds;
|
||||
use App\Classes\Modules\Exports\Services\ExportsWhiteFormTransactions;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Classes\General\AWSS3Helper;
|
||||
use App\Classes\Modules\Exports\Services\ExportsAllCustomersInfoForLarkSystem;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class ExportCustomersToExcelController
|
||||
@@ -241,5 +242,25 @@ class ExportCustomersToExcelController
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
public function exportAllCustomersInfoForLarkSystem(Request $request)
|
||||
{
|
||||
$password = $request->input('password');
|
||||
if ($password !== 'all_customers_data') {
|
||||
return response()->json(['error' => 'Invalid password'], 403);
|
||||
}
|
||||
|
||||
$exportsAllCustomersInfoForLarkSystem = new ExportsAllCustomersInfoForLarkSystem($request);
|
||||
$exportFileName = 'all_customers_info_for_lark_system.xls';
|
||||
|
||||
$filesystemDriver = Storage::getDefaultDriver();
|
||||
if ($filesystemDriver === 's3') {
|
||||
return response(['src' => AWSS3Helper::S3Exportable($exportFileName, $exportsAllCustomersInfoForLarkSystem)]);
|
||||
} else {
|
||||
$response = $exportsAllCustomersInfoForLarkSystem->download($exportFileName, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user