mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
order profile pagination
This commit is contained in:
@@ -54,10 +54,10 @@ class OrderV2Resource extends JsonResource
|
|||||||
'address' => new AddressResource($this->addresses()->where('status', '=', ApprovalStatus::APPROVED)->first()),
|
'address' => new AddressResource($this->addresses()->where('status', '=', ApprovalStatus::APPROVED)->first()),
|
||||||
'address_change_request' => new AddressResource($this->addressesPendingVerification()->first()),
|
'address_change_request' => new AddressResource($this->addressesPendingVerification()->first()),
|
||||||
'invoices' => $invoicePerPage ?
|
'invoices' => $invoicePerPage ?
|
||||||
$this->whenLoaded('packingLists', function () {
|
[]
|
||||||
|
: $this->whenLoaded('packingLists', function () {
|
||||||
return TransactionWithStorageResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get());
|
return TransactionWithStorageResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get());
|
||||||
})
|
}),
|
||||||
: null,
|
|
||||||
'storages' => $this->storages ? $this->storages : null, //from middleware
|
'storages' => $this->storages ? $this->storages : null, //from middleware
|
||||||
'remarks' => RemarkResource::collection($this->remarks),
|
'remarks' => RemarkResource::collection($this->remarks),
|
||||||
'supplier_tax_rebate' => SupplierTaxRebateResource::collection($this->supplierTaxRebate),
|
'supplier_tax_rebate' => SupplierTaxRebateResource::collection($this->supplierTaxRebate),
|
||||||
|
|||||||
Reference in New Issue
Block a user