P粉6511093972023-08-01 16:21:09
Try to combine two columns into one condition.
$now = Carbon::now(); MyModel::whereRaw("CONCAT(`date`, ' ', `time`) >= ?", [$now->toDateTimeString()])->get();
For SQL Server, try the following.
MyModel::whereRaw("CONVERT(datetime, date + ' ' + CONVERT(varchar, time, 121)) >= ?", [$now->toDateTimeString()])->get();
Query transformation may need updating, please consult the documentation for more information.