| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\LogModelChanging;
- class StationTask extends Model
- {
- use LogModelChanging;
- 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");
- }
- }
|