BuildingEnterLog.php 1.1 KB
<?php
namespace app\index\model;

use think\Model;

class BuildingEnterLog extends Model
{
    const APPLY = 1;
    const AGREE = 2;
    const REJECT = 3;
    CONST EXPIRE = 4;
    protected $table  = 'fa_building_enter_log';

    protected $autoWriteTimestamp = 'int';
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';
    // 追加属性
    protected $append = [
    ];
    /**
     * 获取器:创建时间
     * @param $value
     * @return false|string
     */
    public function getCreateTimeAttr($value)
    {
        return $value > 0 ? date('Y-m-d H:i:s', $value) : 0;
    }

    /**
     * 获取器:创建时间
     * @param $value
     * @return false|string
     */
    public function getLogTypeAttr($value)
    {
        if($value == self::APPLY) {
            return '入驻申请已提交';
        } else if($value == self::AGREE) {
            return '入驻申请已同意';
        }else if($value == self::REJECT){
            return '入驻申请已驳回';
        }else{
            return '入驻已到期';
        }
    }


}