RoomOrder.php 894 字节
<?php
namespace app\school\model\project_appointment;

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

class RoomOrder extends Model
{
    use SoftDelete;
    // 数据表名称
    protected $name = 'project_room_order';

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    protected $append = [
        'status_text'
    ];

    public function getStatusList()
    {
        return ['1' => __('待审核'), '2' => __('已通过'),'3' => __('未通过')];
    }

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





}