<?php
/**
 * Created by PhpStorm.
 * User: zilongs
 * Date: 20-10-4
 * Time: 下午10:09
 */

namespace App\Models;

class Team extends BaseModel
{
    public function getTagsAttribute($value)
    {
        return explode(',', $value);
    }

    public function setMemberAttribute($value)
    {
        $this->attributes['member'] = implode(',', $value);
    }
    public function TeamDocter()
    {
        return $this->belongsTo(TeamDocter::class,'team_id','id');
    }
    public function docter()
    {
        return $this->belongsToMany(Docter::class, 'team_docters');
    }
    public function DocterOrganization(){
        return $this->belongsTo(DocterOrganization::class);
    }
    public function servicepack(){
        return $this->belongsTo(ServicePack::class);
    }
}
