我尝试将数据从特定的时间戳获取到数据库DT中。 我尝试这个但没有用 代码:
Route::get('/l', function(){
$day = date('Y-m-d H:i:s', strtotime($_GET['day']));
$users = DB::select('select * from DT where (`timestamp` = "'.$day.'")' );
return $users;
})->middleware('auth:api');
在邮递员中,我置入参数:day 2020-07-01
有帮助吗?
答案 0 :(得分:0)
解决了!
Route::get('/l', function(){
$day = date('Y-m-d ', strtotime($_GET['day']));
$users = DB::select('select * from DT where (`timestamp` like "'.$day.'%")' );
})->middleware('auth:api');