'医院', self::ORGANIZATION => '机构', self::CLINC => '医院', ]; public static function getType() { return self::$_getType; } public function docter() { $ret = $this->belongsToMany(Docter::class)->where('status', 1); $req = request()->post(); if (!empty($req['schedule_type'])) { $ret->where('type', $req['schedule_type']); } return $ret; } public function vaccines() { return $this->belongsToMany(Vaccines::class,'vaccines_id'); } public function user() { return $this->hasOne(CdmsUsers::class,'org_id','id'); } public function communityNotice() { return $this->hasOne(CommunityNotice::class, 'organization_id', 'id'); } public function offices(){ return $this->hasMany(Office::class,'org_id','id'); } public function docterOrganization() { return $this->hasMany(DocterOrganization::class)->where('state', 1)->where('authentication_end_time', '>', time()); } public function getCanVaccineDaysAttribute() { $show_days = DocterSetting::where('org_id', $this->id)->where('type', 2)->value('show_days'); return !empty($show_days) ? $show_days : 0; } public function getCanNurseDaysAttribute() { $show_days = DocterSetting::where('org_id', $this->id)->where('type', 3)->value('show_days'); return !empty($show_days) ? $show_days : 0; } }