我在 Lumen 中使用 Laravel 高级 wheres 在 MongoDB 中进行查询,我对 Lumen 使用 jenssegers/laravel-mongodb 包,我的查询是:
$time_5_min_ago = Carbon::now()->subMinute(5);
$time_10_min_ago = Carbon::now()->subMinute(10);
$time_15_min_ago = Carbon::now()->subMinute(15);
return Order::whereBetween('source_longitude', [$minLon_try_one, $maxLon_try_one])
->whereBetween('source_latitude',[$minLat_try_one,$maxLat_try_one])
->where('status','=','suspend')
->where('created_at','<=',$time_5_min_ago)
->where('created_at','>=',$time_10_min_ago)
->orWhere(function($query) use ($maxLat_try_two,$minLat_try_two,$maxLon_try_two,$minLon_try_two,$time_10_min_ago,$time_15_min_ago)
{
$query->whereBetween('source_longitude', [$minLon_try_two, $maxLon_try_two])
->whereBetween('source_latitude',[$minLat_try_two,$maxLat_try_two])
->where('status','=','suspend')
->where('created_at','<=',$time_10_min_ago)
->where('created_at','>=',$time_15_min_ago);
}
)->get();
但是当我运行这个查询时,我没有得到任何结果,我不知道如何修复它?