本文整理匯總了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);
}