本文整理汇总了PHP中Flight::whereMissing方法的典型用法代码示例。如果您正苦于以下问题:PHP Flight::whereMissing方法的具体用法?PHP Flight::whereMissing怎么用?PHP Flight::whereMissing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flight
的用法示例。
在下文中一共展示了Flight::whereMissing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
function fire($job, $data = null)
{
$job->delete();
$flights = Flight::whereMissing(true)->select('flights.id', 'updates.timestamp')->join('positions', 'flights.id', '=', 'positions.flight_id')->join('updates', 'positions.update_id', '=', 'updates.id')->take(10000)->get();
foreach ($flights as $flight) {
if (Carbon::now()->diffInMinutes(Carbon::parse($flight->timestamp)) >= 60) {
$flight->delete();
// Log::info('queue:datafeed[' . $job->getJobId() . '] deleted flight #' . $flight->id . ', missing: ' . Carbon::now()->diffInMinutes(Carbon::parse($flight->timestamp)));
}
unset($flight);
}
}
示例2: map
/**
* Prepares an array for the map and stores it in the database.
*
* @return void
*/
protected function map()
{
$flights = Flight::whereMissing(false)->whereIn('state', [1, 3])->join('pilots', 'flights.vatsim_id', '=', 'pilots.vatsim_id')->select('flights.*', 'pilots.name')->get()->transform(function ($flight) {
return ['id' => $flight->id, 'callsign' => $flight->callsign, 'vatsim_id' => $flight->vatsim_id, 'pilot' => $flight->name, 'departure' => $flight->departure_id, 'arrival' => $flight->arrival_id, 'aircraft_code' => $flight->aircraft_code, 'aircraft_id' => $flight->aircraft_id, 'lat' => $flight->last_lat, 'lon' => $flight->last_lon, 'altitude' => $flight->last_altitude, 'speed' => $flight->last_speed, 'heading' => $flight->last_heading];
});
Cache::forever('vatsim.map', $flights);
unset($flights);
}