<?php
namespace frontend\models;

use Yii;

class LottoRecordApi extends BaseApi
{
    public $apiUrl = 'lotto-record';

    /**
     * 中奖记录列表
     * @param array $data
     * @return array
     */
    public function getList($data)
    {
        $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 deleteLottoRecord($data)
    {
        $result = $this->post($this->apiUrl . '/delete', $data);
        if ($result['code'] == 1) {
            return $this->returnArray(1, $result['data']);
        } else {
            return $this->returnArray(0, [], $result['message']);
        }
    }

    public function add($data = [])
    {
        $result = $this->post($this->apiUrl . '/add', $data);
        if ($result['code'] == 1) {
            return $this->returnArray(1, $result['data'], '保存成功');
        } else {
            return $this->returnArray(0, [], $result['message']);
        }
    }

}