Merge branch 'customer_latest_order_date_export_master' into 'master'

customer export

See merge request CIEFWorldwideSdnBhd/shipping-portal!98
This commit is contained in:
omair saleh
2022-01-27 03:50:45 +00:00
2 changed files with 3 additions and 18 deletions
@@ -16,4 +16,4 @@ class ExportCustomersToExcelController
$request->headers->set('Authorization', 'Bearer '.$token);
return $exportsCustomers->download('customer-latest-order-date.csv', Excel::CSV, ['Content-Type' => 'text/csv']);
}
}
}
+2 -17
View File
@@ -183,22 +183,7 @@ Route::get('/debug', function (){
});
Route::get('/yd', function (){
FetchOrdersFromYDPortalJob::dispatch();
(App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();;
});
Route::get('/min_cbm', function (){
$companies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orders', function ($query){
return $query->whereHas('packingLists')->whereDoesntHave('packingLists', function($query){
return $query->whereHas('packages', function($query){
return $query->selectRaw('sum((width/100) * (height/100) * (length/100) * quantity) as cbm')->where('type', \App\Classes\ValueObjects\Constants\PackingListType::SHIPPING_PACKING_LIST)->where('status', '!=', 5)->having('cbm', '>', 0.3);
});
});
})->limit(1)->get();
$i = 0;
foreach ($companies as $company) {
$marking = $company->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
echo '<a href="'.route('customer.profile', $marking).'" target="_blank">'.$i++.'. '.$marking.'</a><br>';
}
});
Route::get('/export/customer-latest-order-date/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
Route::get('/export/customer-latest-order-date/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');