Update FormHelper.php

This commit is contained in:
Jagad R R
2025-01-19 19:17:09 +07:00
parent 2b2f2f5ce1
commit a393f3f46f
+4 -4
View File
@@ -14,8 +14,8 @@ use App\Models\UserHasCabang;
class FormHelper class FormHelper
{ {
public static function getFormsByUserIds($userIds, $month, $year) { public static function getFormsByUserIds($userIds, $month, $year) {
$startDate = date('Y-m-' . env('STARTING_DATE')); $startDate = date("$year-$month-" . env('STARTING_DATE'));
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE'); $closingDateNextMonth = date("$year-$month-", strtotime("+1 month", strtotime("$year-$month-01"))) . env('CLOSING_DATE');
$users = Admin::with(['region', 'cabang']) $users = Admin::with(['region', 'cabang'])
->whereIn('id', $userIds) ->whereIn('id', $userIds)
@@ -98,8 +98,8 @@ class FormHelper
} }
public static function getAllForms($month, $year) { public static function getAllForms($month, $year) {
$startDate = date('Y-m-' . env('STARTING_DATE')); $startDate = date("$year-$month-" . env('STARTING_DATE'));
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE'); $closingDateNextMonth = date("$year-$month-", strtotime("+1 month", strtotime("$year-$month-01"))) . env('CLOSING_DATE');
$users = Admin::with(['region', 'cabang']) $users = Admin::with(['region', 'cabang'])
->get(); ->get();