steelerboi Posted May 4, 2009 Report Share Posted May 4, 2009 When logged in as admin and viewing the overview report (reports & expenses), my aircraft usage was showing weird hours and miles totals. A quick delve into the StatsData.class.php showed that the sql query for AircraftUsage was using COUNT() rather than SUM(), i.e. public static function AircraftUsage() { $sql = 'SELECT a.name AS aircraft, a.registration, SUM(p.flighttime) AS hours, SUM(p.distance) AS distance FROM '.TABLE_PREFIX.'pireps p INNER JOIN '.TABLE_PREFIX.'aircraft a ON p.aircraft = a.id GROUP BY p.aircraft'; I changed the query accordingly and the totals now show correct values. Nabeel, was this the right thing to do, or was I missing something elsewhere ? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 4, 2009 Administrators Report Share Posted May 4, 2009 Yep it was supposed to be SUM(). I've changed it on my end, thanks! Quote Link to comment Share on other sites More sharing options...
Simon VVair Posted December 9, 2009 Report Share Posted December 9, 2009 Ciao Nabeen, since this post is allready open i'll use it. regarding this feature : Aircraft Usage Aircraft Hours and Usage Aircraft Hours Miles A320-200 (I-VVAB) 01:15:43 26508 ATR72 (I-VVAT) 00:03:28 761 B737-800 (I-VVBS) 01:22:53 27503 EMB-170 (I-VVEM) 00:23:10 6933 MD82 (I-VVMD) 00:54:38 19923 MD-11 (I-VVSG) 00:09:10 4471 version 813, i think there is still a problem. Ffor example the ATR total time is 3 hours, but from this page it seems to be 3 minutes 28 seconds. So other example, the B737, 27000 miles in 1.22 hours? Should be changed to 82 hours and 53 minutes (that is 60 hours + 22 and not 01:22) Hope you understand my poor english Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 9, 2009 Administrators Report Share Posted December 9, 2009 Can you open a bug on the bug tracker? thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.