<?php

namespace Modules\User\Http\Resources\Account;

use Illuminate\Http\Resources\Json\JsonResource;

class UserAccountResource extends JsonResource
{

    public function toArray($request): array
    {
        return [
            'balance' => floatval($this->balance),//现金
            'score'   => [
                'surplus' => floatval($this->score),//水滴余量
                'use'     => 0,//水滴使用
                'plan'    => 300,//水滴赠送
            ],
        ];
    }

}