Профиль хирургии

This commit is contained in:
brusnitsyn
2026-03-25 17:37:32 +09:00
parent 52a80ccd3b
commit f566ab96df
75 changed files with 3841 additions and 1009 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
class Department extends Model
{
@@ -36,4 +37,19 @@ class Department extends Model
{
return $this->belongsTo(DepartmentType::class, 'rf_department_type', 'department_type_id');
}
public function userDepartment()
{
return $this->belongsTo(UserDepartment::class, 'rf_department_id', 'department_id');
}
public function recipientPlanOfYear()
{
$now = Carbon::now();
return $this->metrikaDefault()
->where('date_end', '>', $now)
->where('rf_metrika_item_id', 23)
->first();
}
}