<?php
namespace App\Models;
class Uservip extends BaseModel {
	protected $table = "user_vip";
    public $timestamps = false;

    function getList($list=50,$where){
        $data=$this->orderby('addtime','desc')->where($where);
        if(!$data){
            return -6010000122;
        }
        $data = $data->paginate($list);
        $data = $data->toArray();
        foreach ($data['data'] as $key => $value) {
            if($value['status'] == 1){
                $data['data'][$key]['status'] ='审核中';
            }elseif($value['status'] == 2){
                $data['data'][$key]['status'] ='审核通过';
            }elseif($value['status'] == 3){
                $data['data'][$key]['status'] ='审核未通过';
            }
        }
        return $data;
    }

    //更新设置
    function updateVip($data,$id){
        $res=$this->where('id',$id)->update($data);
        if(!$res){
            return -7020050022;//更新失败
        }
        return 1;
    }

}
