<?php


/**
 * Created by PhpStorm.
 * User: zilongs
 * Date: 20-9-29
 * Time: 上午11:12
 */

namespace App\Models;

class DocterOrganization extends BaseModel
{
    protected $table='docter_organization';
    public $timestamps = true;
    protected $casts = [
        'card_photo' => 'json',
    ];
    //医生类型(1.问诊医生 2.疫苗医生 3.儿保医生)
    public  static $_doct_type = [1=>'门诊医生',2=>'疫苗医生',3=>'儿保医生'];



    public function docter()
    {
        return $this->hasOne(Docter::class, 'id', 'docter_id');
    }

    public function office()
    {
        return $this->hasOne(Office::class,'id','offices_id');
//        return $this->belongsTo(Office::class,'offices_id','id');
    }

//    public function qualification()
//    {
//        return $this->hasOne(Qualification::class,'id','qualifications_id');
//    }


    public function organization()
    {
        return $this->hasOne(Organization::class,'id','organization_id');
    }

    public  function teamdocter()
    {
        return $this->hasOne(TeamDocter::class,'docter_id','docter_id');
    }

    public  function Serviceapplys()
    {
        return $this->belongsTo(Serviceapplys::class,'docter_id','docter_id');

    }
    public function qualification()
    {
        return $this->belongsTo(Qualification::class,'qualifications_id','id');
    }
}
