微调
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Mall\Http\Resources\Api\Order;
|
||||
|
||||
use App\Api\Resources\Area\AreaCodeVerifyResource;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class OrderAreaCodeResource extends JsonResource
|
||||
{
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'order_no' => $this->order_no,
|
||||
'amount' => $this->amount,
|
||||
'freight' => $this->freight,
|
||||
'total' => $this->total,
|
||||
'state' => [
|
||||
'value' => $this->state,
|
||||
'text' => $this->state_text,
|
||||
],
|
||||
'can' => $this->getCanAction(),
|
||||
'items' => OrderItemResource::collection($this->items),
|
||||
'area_code' => new AreaCodeVerifyResource($this->areaCode),
|
||||
'remark' => (string) $this->remark,
|
||||
'created_at' => (string) $this->created_at,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user