<?php

namespace app\api\model;

use think\Model;


class User extends Model
{

    

    

    // 表名
    protected $name = 'user';

    public function getGenderList()
    {
        return ['1' => __('Gender 1'), '0' => __('Gender 0')];
    }

    public function getIdcardStatusList()
    {
        return ['-1' => __('Idcard_status -1'),'0' => __('Idcard_status 0'),'1' => __('Idcard_status 1'), '2' => __('Idcard_status 2')];
    }

    public function getStatusList()
    {
        return ['1' => __('Status 1'), '0' => __('Status 0')];
    }


    public function getGenderTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['gender']) ? $data['gender'] : '');
        $list = $this->getGenderList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIdcardStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['idcard_status']) ? $data['idcard_status'] : '');
        $list = $this->getIdcardStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }



    public function getStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
        $list = $this->getStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }



}
