商品详情
This commit is contained in:
parent
5fc7893764
commit
46d38c0cce
|
|
@ -17,6 +17,7 @@ class Product extends Model
|
|||
];
|
||||
protected $casts = [
|
||||
'active' => 'boolean',
|
||||
'variables' => 'array',
|
||||
];
|
||||
|
||||
public function categories()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ProductDetail extends JsonResource
|
|||
'description' => $this->description->description ?? '',
|
||||
'image' => image_resize($this->image),
|
||||
'category_id' => $this->category_id ?? null,
|
||||
'variables' => json_decode($this->variables),
|
||||
'variables' => $this->variables,
|
||||
'skus' => SkuDetail::collection($this->skus)->jsonSerialize(),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class SkuDetail extends JsonResource
|
|||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'variants' => json_decode($this->varians),
|
||||
'variants' => $this->variants,
|
||||
'position' => $this->position,
|
||||
'image' => image_resize($this->image),
|
||||
'model' => $this->model,
|
||||
|
|
|
|||
Loading…
Reference in New Issue