Station.php 680 字节
<?php

namespace app\school\model\station;

use think\Model;
use traits\model\SoftDelete;

class Station extends Model
{
    use SoftDelete;
    // 表名
    protected $name = 'station';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

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

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

    public function getStatusTextAttr($value,$data)
    {
        return isset($data['status']) ? ($data['status'] == 1 ? '开放' : '不开放') : '';
    }
    







}