From 3801c86ea2c3ee3ccb0365ea3d5809aa3339ed5a Mon Sep 17 00:00:00 2001 From: anazaryan Date: Fri, 15 Nov 2024 17:28:21 +0400 Subject: [PATCH] fix autolift left days --- app/Http/Controllers/EmployerController.php | 9 ++++++++- resources/views/employers/vacancy_autolift.blade.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 4ec69a1..2025c7c 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -797,7 +797,14 @@ class EmployerController extends Controller $options = $employer->autoliftOptions ?? new EmployerAutoliftOption(); - return view('employers.vacancy_autolift', compact('vacancies', 'options')); + $leftDays = 0; + + if ($options->days_repeat) { + $leftDays = $options->days_repeat - now()->diffInDays(Carbon::parse($options->created_at)); + } + + + return view('employers.vacancy_autolift', compact('vacancies', 'options', 'leftDays')); } /** diff --git a/resources/views/employers/vacancy_autolift.blade.php b/resources/views/employers/vacancy_autolift.blade.php index d2190b8..c597582 100644 --- a/resources/views/employers/vacancy_autolift.blade.php +++ b/resources/views/employers/vacancy_autolift.blade.php @@ -69,7 +69,7 @@ Активировано - +