<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\MorphOne;

class StationTaskBatch extends Model
{
    protected $fillable=['batch_id','station_id','station_task_batch_type_id','status'];

    function station(): HasOne
    {
        return $this->hasOne(Station::class);
    }
    function stationTask(): MorphOne
    {
        return $this->morphOne(StationTask::class,'station_taskable');
    }

    public function batch(): HasOne
    {   //波次
        return $this->hasOne(Batch::class,"id","batch_id");
    }
}
