mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
customer report
This commit is contained in:
+4
-4
@@ -133,7 +133,7 @@ Route::get('/report', function(){
|
||||
$containers = Container::whereMonth('loading_date', '=', '09')->whereYear('loading_date', '=', '2021')->get();
|
||||
|
||||
$total = 0;
|
||||
$customers = [];
|
||||
$customers = collect();
|
||||
|
||||
foreach ($containers as $container){
|
||||
foreach($container->packingLists as $packingList){
|
||||
@@ -142,13 +142,13 @@ Route::get('/report', function(){
|
||||
});
|
||||
|
||||
$total += $cbm;
|
||||
if(!array_key_exists($packingList->owner->id, $customers)){
|
||||
if(!$customers->has($packingList->owner->id)){
|
||||
$marking = $packingList->owner->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
|
||||
$customers[$packingList->owner->id] = [
|
||||
$customers->put($packingList->owner->id, collect([
|
||||
'marking' => $marking,
|
||||
'cbm' => $cbm,
|
||||
'packages' => $packingList->packages->sum('quantity')
|
||||
];
|
||||
]));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user