<?php

namespace app\model;

use DateTimeInterface;
use support\Model;

class TaskProcess extends Model
{
    protected $table = 'task_process';

    protected $primaryKey = 'task_process_id';

    protected $dateFormat = 'U';

    const CREATED_AT = 'task_process_addtimes';

    const UPDATED_AT = null;

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

    /**
     * @Desc 管理管理员
     * @Author Gorden
     * @Date 2024/4/8 11:23
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function user()
    {
        return $this->hasOne(SysUser::class, 'user_id', 'join_task_process_user_id')
            ->select('user_id','user_name','user_login_name');
    }
}