<?php
namespace backend\models;

use Yii;

class VolumeApi extends BaseApi
{
    
    public $apiUrl = 'volume';

    /**
     * @param array $data
     * @return array
     */
    public function getList($data)
    {
        $data['member_id']  = Yii::$app->user->id;
        $result = $this->post($this->apiUrl . '/list', $data);
        if ($result['code'] == 1) {
            return $this->returnArray(1, $result['data']);
        } else {
            return $this->returnArray(0, [], $result['message']);
        }
    }

    /**
     * @param array $data
     * @return array
     */
    public function cal($data)
    {
        $data['member_id']  = Yii::$app->user->id;
        $result = $this->post($this->apiUrl . '/cal', $data);
        if ($result['code'] == 1) {
            return $this->returnArray(1, $result['data']);
        } else {
            return $this->returnArray(0, [], $result['message']);
        }
    }
}