order profile pagination

This commit is contained in:
Edmond Lang
2025-07-03 10:26:24 +08:00
parent ff86009ddf
commit 4d79571f48
+3 -3
View File
@@ -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),