Changeset 485 for trunk/banners.php
- Timestamp:
- Jun 18, 2010, 7:33:21 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/banners.php
r484 r485 24 24 25 25 26 $Query = 'SELECT * , (`Hits` + COALESCE((SELECT SUM(`Hits`) FROM `Referrer` AS `T1` WHERE `T1`.`Parent` = `T2`.`Id`), 0)) AS `TotalHits` FROM `Referrer` AS `T2` WHERE (`Show`=1) AND (`Parent`=0) AND (`DateLast` > (NOW() - INTERVAL '.$MonthAge.' MONTH))';26 $Query = 'SELECT * FROM (SELECT *, (`Hits` + COALESCE((SELECT SUM(`Hits`) FROM `Referrer` AS `T1` WHERE `T1`.`Parent` = `T2`.`Id`), 0)) AS `TotalHits`, GREATEST(`DateLast`, COALESCE((SELECT MAX(`DateLast`) FROM `Referrer` AS `T1` WHERE `T1`.`Parent` = `T2`.`Id`), 0)) AS `MaxDateLast` FROM `Referrer` AS `T2` WHERE (`Show`=1) AND (`Parent`=0)) AS `T3` WHERE (`T3`.`MaxDateLast` > (NOW() - INTERVAL '.$MonthAge.' MONTH))'; 27 27 28 28 … … 36 36 $TableColumns = array( 37 37 array('Name' => 'Web', 'Title' => 'Adresa'), 38 array('Name' => ' DateLast', 'Title' => 'Naposledy'),38 array('Name' => 'MaxDateLast', 'Title' => 'Naposledy'), 39 39 array('Name' => 'TotalHits', 'Title' => 'Příchodů'), 40 40 ); 41 $Order = GetOrderTableHeader($TableColumns, ' DateLast', 1);41 $Order = GetOrderTableHeader($TableColumns, 'MaxDateLast', 1); 42 42 echo($Order['Output']); 43 43 … … 48 48 { 49 49 echo('<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'. 50 '<td>'.HumanDate($Line[' DateLast']).'</td>'.50 '<td>'.HumanDate($Line['MaxDateLast']).'</td>'. 51 51 '<td>'.$Line['TotalHits'].'</td></tr>'); 52 52 }
Note:
See TracChangeset
for help on using the changeset viewer.