Изменил пороги цвета и привязку процента к выбранной дате

This commit is contained in:
Brusnitsyn
2026-07-06 13:36:30 +00:00
parent 9d8177c086
commit 86a33f2e46
5 changed files with 18 additions and 21 deletions

View File

@@ -43,12 +43,12 @@ class Department extends Model
return $this->belongsTo(UserDepartment::class, 'department_id', 'rf_department_id');
}
public function recipientPlanOfYear()
public function recipientPlanOfYear(?Carbon $asOf = null)
{
$now = Carbon::now();
$asOf = $asOf ?? Carbon::now();
return $this->metrikaDefault()
->where('date_end', '>', $now)
->where('date_end', '>', $asOf)
->where('rf_metrika_item_id', 23)
->first();
}