26 lines
706 B
PHP
26 lines
706 B
PHP
<?php
|
|
|
|
namespace Peidikeji\Order\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class OrderShipResouce extends JsonResource
|
|
{
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'order_id' => $this->order_id,
|
|
'sn' => $this->sn,
|
|
'ship_status' => $this->ship_status,
|
|
'ship_status_text' => $this->ship_status->text(),
|
|
'ship_data' => $this->ship_data,
|
|
'ship_address' => $this->ship_address,
|
|
'finish_at' => $this->finish_at?->timestamp,
|
|
'created_at' => $this->created_at?->timestamp,
|
|
|
|
'goods' => $this->whenLoaded('goods'),
|
|
];
|
|
}
|
|
}
|