diff --git a/laravel_app/app/Models/Project.php b/laravel_app/app/Models/Project.php index 2aaf309..6aed43e 100644 --- a/laravel_app/app/Models/Project.php +++ b/laravel_app/app/Models/Project.php @@ -346,28 +346,6 @@ public function getFileDownloadsFor(Carbon $endDate, int $offset = 7): array public function getMosaicsFor(Carbon $endDate, int $offset = 7): array { return collect(range(0, 3)) -// ->map(function ($periodDiff) use ($endDate, $offset) { -// $calculatedEndDate = $endDate->clone(); -// $calculatedOffset = (int) $endDate->clone()->previous($this->mail_day)->diffInDays($endDate); -// if ($calculatedOffset === 7) { -// $calculatedOffset = 1; -// } -// if ($periodDiff !== 0) { -// if ($calculatedOffset === 1) { -// for ($i = 1; $i < $periodDiff; $i++) { -// $calculatedEndDate->previous($this->mail_day); -// } -// } else { -// for ($i = 0; $i < $periodDiff; $i++) { -// $calculatedEndDate->previous($this->mail_day); -// } -// } -// $calculatedOffset = 7; -// $calculatedEndDate->subDay(); -// } -// -// return ProjectMosiacGeneratorJob::handleFor($this, $calculatedEndDate, $calculatedOffset); -// }) ->map(function() use ($endDate, $offset){ $currentEndDate = $endDate->clone(); if (!$currentEndDate->isDayOfWeek($this->mail_day)) { @@ -378,7 +356,6 @@ public function getMosaicsFor(Carbon $endDate, int $offset = 7): array return ProjectMosiacGeneratorJob::handleFor($this, $currentEndDate, $calculatedOffSet); }) - ->filter() ->toArray(); }