<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class StationTaskCommodity extends Model
{
    protected $fillable= ['station_id','material_box_id','commodity_id','amount','order_id','status',"bin_number"];

    public function commodity()
    {   //商品
        return $this->hasOne(Commodity::class,"id","commodity_id");
    }
    public function materialBox()
    {   //料箱
        return $this->hasOne(MaterialBox::class,"id","material_box_id");
    }
    function parentTask(){
        return $this->morphOne(StationTask::class,'station_taskable');
    }
}
