<?php

namespace app\admin\model\zekxsOaIiH;

use think\Model;


class Company extends Model
{

    

    

    // 表名
    protected $name = 'company';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'wechat_encode_text',
        'pay_weixin_open_text'
    ];
    

    
    public function getWechatEncodeList()
    {
        return ['0' => __('Wechat_encode 0'), '1' => __('Wechat_encode 1'), '2' => __('Wechat_encode 2')];
    }

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


    public function getWechatEncodeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['wechat_encode']) ? $data['wechat_encode'] : '');
        $list = $this->getWechatEncodeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getPayWeixinOpenTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['pay_weixin_open']) ? $data['pay_weixin_open'] : '');
        $list = $this->getPayWeixinOpenList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
