我正试图仅基于小时和分钟参数来获取当前时间的所有提醒。我该怎么办?
reminders = Reminders::whereDate('scheduled_at', Carbon::now())
->where('is_delivered', false)
->get();
答案 0 :(得分:0)
尝试一下:
$reminders = Reminders::whereTime('scheduled_at', Carbon::now()->format('H:i'))
->where('is_delivered', false)
->get();
答案 1 :(得分:-1)
尝试一下:
$reminders = Reminders::where('scheduled_at', Carbon::now())->where('is_delivered', false)->get();