@@ -24,9 +24,10 @@ public function index()
24
24
return view ('hr.recruitment.reportcard ' );
25
25
}
26
26
27
- public function searchBydate (Request $ req )
27
+ public function searchBydate (Request $ request )
28
28
{
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 ());
30
31
31
32
$ todayCount = Applicant::whereDate ('created_at ' , '= ' , Carbon::today ())
32
33
->count ();
@@ -36,8 +37,8 @@ public function searchBydate(Request $req)
36
37
\DB ::raw ('MONTHNAME(created_at) as month_created_at ' ),
37
38
\DB ::raw ('DATE(created_at) as date_created_at ' ),
38
39
)
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 )
41
42
->groupBy ('date_created_at ' , 'month_created_at ' )
42
43
->orderBy ('date_created_at ' , 'ASC ' )
43
44
->get ();
0 commit comments