<?php

namespace Modules\User\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class UserIdentityBaseResource extends JsonResource
{

    public function toArray($request): array
    {
        return [
            'id'        => $this->id,
            'name'      => $this->name,
            'cover'     => $this->cover_url,
            'order'     => $this->order,
            'stock'     => $this->stock,//多少箱
            'bottle'    => bcmul($this->stock, 24),//多少瓶
            'price'     => $this->getCondition('price', 0),//多少钱
            'rights'    => $this->rights,//可享受权益
            'rules'     => $this->getRules(),//身份权益
            'not_rules' => $this->getNotRules(),

        ];
    }

}
