'int', 'medical_question_id'=> 'int', 'content' => 'string', 'score' => 'float' ]; /** * 允许批量赋值的字段 * @var array */ protected $allowField = [ 'medical_question_id', 'content', 'score' ]; /** * 获取所属问题 */ public function question() { return $this->belongsTo(MedicalQuestion::class, 'medical_question_id', 'id'); } }