<?php
/**
 * Created by PhpStorm.
 * User: chenkuan
 * Date: 2017/11/8
 * Time: 上午10:10
 */

namespace backend\models;


class LeverApi extends BaseApi
{
    public $apiUrl = 'lever';

    public function Lever($member_id)
    {
        $result = $this->get($this->apiUrl.'/lever', ['member_id' => $member_id]);
        if ($result['code'] == 1) {
            return $this->returnArray(1, $result['data'], $result['message']);
        } else {
            return $this->returnArray(0, [], $result['message']);
        }
    }

    public function getLeverList($data = [])
    {
        $result = $this->get($this->apiUrl.'/index', $data);
        if ($result['code'] == 1) {
            return $this->returnArray(1, $result['data'], '获取记录成功');
        } else {
            return $this->returnArray(0, [], '获取记录失败');
        }
    }

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

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

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