first
This commit is contained in:
32
modules/Mall/Http/Resources/Api/Order/OrderResource.php
Normal file
32
modules/Mall/Http/Resources/Api/Order/OrderResource.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Mall\Http\Resources\Api\Order;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Modules\Mall\Http\Resources\Api\Shop\ShopBaseInfoResource;
|
||||
|
||||
class OrderResource extends JsonResource
|
||||
{
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'order_no' => $this->order_no,
|
||||
'shop' => new ShopBaseInfoResource($this->shop),
|
||||
'amount' => $this->amount,
|
||||
'freight' => $this->freight,
|
||||
'total' => $this->total,
|
||||
'type' => $this->type_text,
|
||||
'state' => $this->state_text,
|
||||
'can' => $this->getCanAction(),
|
||||
'is_logistic_show' => $this->is_logistic_show,
|
||||
'items' => OrderItemResource::collection($this->items),
|
||||
'express' => new OrderExpressResource($this->express),
|
||||
'remark' => (string) $this->remark,
|
||||
'expired_at' => (string) $this->expired_at,
|
||||
'paid_at' => (string) $this->paid_at,
|
||||
'created_at' => (string) $this->created_at,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user