Профиль хирургии
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user