<?php namespace app\model; use think\Model; class TrainType extends Model { public function trainCourse() { return $this->hasMany('TrainCourse','type_id','id'); } }