<?php
/**
 * Created by PhpStorm.
 * User: zilongs
 * Date: 20-10-5
 * Time: 上午11:31
 */

namespace App\Models;

class Suggest extends BaseModel
{


    public function order()
    {
        return $this->belongsTo(Order::class);
    }

    public function suggestsDetail()
    {
        return $this->hasMany(SuggestsDetail::class);
    }
    /**
     * 患者表联查
     * @return mixed
     */
    public function Patient()
    {
        return $this->hasOne(Patient::class,'id','patient_id');
    }

    /**
     * 意见详情表联查
     * @return mixed
     */
    public function details()
    {
        return $this->hasMany(SuggestDetail::class,'suggest_id','id');
    }

    /**
     * 获取用户信息
     * @return mixed
     */
    public function user()
    {
        return $this->hasOne(User::class,'id','user_id');
    }
}
