Skip to content

Commit db46c19

Browse files
coderabbit fix
1 parent a5571d4 commit db46c19

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Modules/HR/Http/Controllers/Recruitment/ReportsController.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ public function index()
2424
return view('hr.recruitment.reportcard');
2525
}
2626

27-
public function searchBydate(Request $req)
27+
public function searchBydate(Request $request)
2828
{
29-
$req->report_start_date = $req->report_start_date ?? Carbon::now()->startOfMonth() == $req->report_end_date = $req->report_end_date ?? Carbon::today();
29+
$reportStartDate = $request->get('report_start_date', Carbon::now()->startOfMonth());
30+
$reportEndDate = $request->get('report_end_date', Carbon::today());
3031

3132
$todayCount = Applicant::whereDate('created_at', '=', Carbon::today())
3233
->count();
@@ -36,8 +37,8 @@ public function searchBydate(Request $req)
3637
\DB::raw('MONTHNAME(created_at) as month_created_at'),
3738
\DB::raw('DATE(created_at) as date_created_at'),
3839
)
39-
->wheredate('created_at', '>=', $req->report_start_date)
40-
->wheredate('created_at', '<=', $req->report_end_date)
40+
->wheredate('created_at', '>=', $reportStartDate)
41+
->wheredate('created_at', '<=', $reportEndDate)
4142
->groupBy('date_created_at', 'month_created_at')
4243
->orderBy('date_created_at', 'ASC')
4344
->get();

0 commit comments

Comments
 (0)