Voici la requête en sql, à toi à la mettre en Eloquent
Code:
1
2
3
4 select * from revision where fk_motorbike = UnNumeroDeMoto and start_time between time_start_training and time_stop_training or start_stop between time_start_training and time_stop_training
Sinon en Laravel, tu peux aussi utiliser DB cela donnerais un truc du genre
Code:
1
2
3
4
5
6
7
8
9
10 $sql = "select * from revision where fk_motorbike = ? and start_time between ? and ? or start_stop between ? and ? " $revision = DB::select($sql,[$request->get('fk_motorbike'),$start_time,$stop_time,$start_time,$stop_time]); OU $revision =collect( DB::select($sql,[$request->get('fk_motorbike'),$start_time,$stop_time,$start_time,$stop_time]))->first();