Standard.php 848 字节
<?php

namespace app\admin\model;

use think\Model;


class Standard extends Model
{

    

    

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

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

    // 追加属性
    protected $append = [
        'is_banner_text'
    ];
    

    
    public function getIsBannerList()
    {
        return ['1' => __('Is_banner 1'), '2' => __('Is_banner 2')];
    }


    public function getIsBannerTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_banner']) ? $data['is_banner'] : '');
        $list = $this->getIsBannerList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}