You're missing a semicolon ; after where('paydate', '<', $data2)
Oct 14, 2018
3
Level 27
date filter
Hello,
I am trying to create a date filter for the report:
MethodNotAllowedHttpException No message
ReportController.php
public function searchViewReport(Request $request) {
$data1 = date("Y-m-d", strtotime($request->start_date));
$data2 = date("Y-m-d", strtotime($request->expire_date));
$Report = ReportModel::leftJoin('tb_m_biller_solusi', function($join){
$join->on('tb_r_solusiorder.productid', '=', 'tb_m_biller_solusi.Productid');
$join->on('tb_r_solusiorder.billerid', '=', 'tb_m_biller_solusi.Billerid');
})
->leftJoin('tb_m_biller', 'tb_r_solusiorder.billerid', '=', 'tb_m_biller.biller_id')
->where(date("Y-m-d",'paydate'), '>', $data1))
->where(date("Y-m-d",'paydate'), '<', $data2));
return view('pages.report.list')
->with('list', $Report)
->with('date1', $data1)
->with('date2', $data2);
}
I think there is an error on this line :
->where(date("Y-m-d",'paydate'), '>', $data1))
Since paydate is date and time I cannot compare it with $data1 which is date only. What should I do?
Please or to participate in this conversation.