Changeset 20 for trunk


Ignore:
Timestamp:
Sep 6, 2019, 9:58:18 AM (5 years ago)
Author:
chronos
Message:
  • Fixed: Summary table was computing wrong values.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r19 r20  
    708708  {
    709709    $DbResult = $this->Database->query('SELECT (SELECT COUNT(*) FROM '.$Table.' WHERE '.$Where.') AS TotalCount, '.
    710       '(SELECT SUM(Distance) FROM '.$Table.'Stat LEFT JOIN '.$Table.' ON '.$Table.'.Id='.$Table.'Stat.'.$Table.' WHERE '.$Where.') AS TotalDistance, '.
    711       '(SELECT SUM(Money) FROM '.$Table.'Stat LEFT JOIN '.$Table.' ON '.$Table.'.Id='.$Table.'Stat.'.$Table.' WHERE '.$Where.') AS TotalMoney');
     710      '(SELECT SUM(T1.Distance) FROM (SELECT (SELECT Distance FROM '.$Table.'Stat WHERE '.$Table.'Stat.'.$Table.' = '.$Table.'.Id ORDER BY Time DESC LIMIT 1) AS Distance FROM '.$Table.' WHERE '.$Where.') AS T1) AS TotalDistance, '.
     711      '(SELECT SUM(T2.Money) FROM (SELECT (SELECT Money FROM '.$Table.'Stat WHERE '.$Table.'Stat.'.$Table.' = '.$Table.'.Id ORDER BY Time DESC LIMIT 1) AS Money FROM '.$Table.' WHERE '.$Where.') AS T2) AS TotalMoney');
    712712    $DbRow = $DbResult->fetch_assoc();
    713713    return $DbRow;
Note: See TracChangeset for help on using the changeset viewer.