<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class StationTask extends Model
{
    protected $fillable = ['status'];

    public function tasks()
    {
        return $this->morphTo();
    }

    public function stationTaskCommodities()
    {   //任务商品列表
        return $this->morphTo()->where("station_task_table_type","station_task_commodities");
    }
    public function stationTaskBatches()
    {   //任务波次 目前为单个，取值时应取第一个即可
        return $this->morphTo()->where("station_task_table_type","station_task_batches");
    }
    public function stationTaskMaterialBoxes()
    {   //任务料箱
        return $this->morphTo()->where("station_task_table_type","station_task_material_boxes");
    }
}
