30 lines
937 B
PHP
30 lines
937 B
PHP
<?php
|
|
|
|
namespace Peidikeji\Goods\Http\Resources;
|
|
|
|
class GoodsResource extends GoodsTinyResource
|
|
{
|
|
public function toArray($request)
|
|
{
|
|
$data = parent::toArray($request);
|
|
|
|
return array_merge($data, [
|
|
'content' => $this->content,
|
|
'weight' => $this->weight,
|
|
'volume' => $this->volume,
|
|
'shipping_tmp_id' => $this->shipping_tmp_id,
|
|
'attr' => $this->attr,
|
|
'part' => $this->part,
|
|
'spec' => $this->spec,
|
|
'created_at' => $this->created_at->timestamp,
|
|
'check_user_id' => $this->check_user_id,
|
|
'check_at' => $this->check_at?->timestamp,
|
|
'check_remarks' => $this->check_remarks,
|
|
'check_status' => $this->check_status,
|
|
'check_status_text' => $this->check_status->text(),
|
|
|
|
'skus' => GoodsSkuResource::collection($this->whenLoaded('skus')),
|
|
]);
|
|
}
|
|
}
|