Skip to content

Commit

Permalink
Fix issue #72 : Sidebar now display latest data even when route/aircr…
Browse files Browse the repository at this point in the history
…aft change for an ident
  • Loading branch information
Ysurac committed Jul 22, 2015
1 parent eab36cd commit a6f1bb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions require/class.SpotterLive.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public static function getLastLiveSpotterDataByIdent($ident)
date_default_timezone_set('UTC');

$ident = filter_var($ident, FILTER_SANITIZE_STRING);
$query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate";
$query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC";

$spotter_array = Spotter::getDataFromDB($query,array(':ident' => $ident));

Expand All @@ -228,7 +228,7 @@ public static function getLastLiveSpotterDataById($id)
date_default_timezone_set('UTC');

$id = filter_var($id, FILTER_SANITIZE_STRING);
$query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate";
$query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC";

$spotter_array = Spotter::getDataFromDB($query,array(':id' => $id));

Expand Down

1 comment on commit a6f1bb2

@tonkepen100
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhhh i change , Thanks Ysurac

Please sign in to comment.