<?php

namespace app\model;

use DateTimeInterface;
use support\Model;

class Customer extends Model
{
    protected $table = 'customer';

    protected $dateFormat = 'U';

    public function serializeDate(DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }

    public function user()
    {
        return $this->hasOne(SysUser::class, 'user_id', 'creator')
            ->select('user_id', 'user_name');
    }
}