<?php

namespace app\admin\model;

class ContractModel extends BaseModel
{
    protected $table = 'contract';

    public function photo(){
        return $this->belongsTo('ReceiptModel','file_id','id');
    }

    public function getEndTimeAttr($value){
        if(is_numeric($value) && (strlen($value) == 11 || strlen($value) == 10)){
            return date('Y-m-d',$value);
        }
    }
}