You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function getincome_ajax(Request $request)
{
$starts = $request->start;
$ende = $request->end;
$course = $request->course;
$start = date('Y-d-m', strtotime($starts));
$end = date('Y-d-m', strtotime($ende));
if (($starts) && ($ende) && ($course))
{
//here is problem when i want search with $starts and $end its not working
$query = Subscription::whereDate('created_at','>=',$start)
->whereDate('created_at','<=',$end)
->where('course_id',$course)
->with('courses');
}
elseif(($starts) && ($ende))
{
//here is problem when i want search with $starts and $end its not working
$query = Subscription::whereDate('created_at','>=',$start)
->whereDate('created_at','<=',$end)
->with('courses');
}
elseif($course)
{
//here if I search with only $course its working fine
$query = Subscription::where('course_id',$course)->with('courses');
}
else
{
$query = Subscription::with('courses');
}
$dataTable = Datatables::of($query)
->addColumn('total', function ($s) {
return $s->tution_fee + $s->development_fee + $s->late_fee + $s->other_fee ;
})
->editColumn('created_at', function ($user) {
return $user->created_at->format('d/m/Y');
});
$columns = ['created_at', 'tution_fee', 'development_fee','late_fee', 'other_fee','total','courses.name'];
$base = new DataTableBase($query, $dataTable, $columns);
return $base->render(null);
}
script
The text was updated successfully, but these errors were encountered: