我在Laravel-5.8中有这个代码
$currentDate = Carbon::now()->format('Y-m-d');
$currentstatus = HrLeaveRequest::select('leave_status')->whereDate('resumption_date, '<=', $currentDate)->whereIn('leave_status', [1, 3, 4])->orderBy('created_at', 'DESC')->first();$currentDate = 2021-05-10
$resumption_date = 2021-05-12
但是当我dd($currentstatus)时,我得到的是null
我该如何解决这个问题?
谢谢
发布于 2021-05-10 19:44:35
将whereDate更改为where,您已提交resumption_date而不是date
https://stackoverflow.com/questions/67469686
复制相似问题