我尝试从特定的时间戳中获取数据到数据库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
有什么帮助吗?
发布于 2020-07-01 21:41:47
解决了!
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');https://stackoverflow.com/questions/62677790
复制相似问题