Exemplo n.º 1
0
 public static function aGetLatestHtmlIDs($sTimespan = '1 day')
 {
     $aIDs = array();
     $sStart = date('Y-m-d H:i:s', strtotime('now - ' . $sTimespan));
     $aRows = DirectDB::aSelectQuery("\n\t\t\t\tSELECT a.id , a.fetched FROM ads_htmls AS a\n\t\t\t\t\tLEFT JOIN ads_htmls As b\n\t\t\t\t\t\tON a.id != b.id\n\t\t\t\t\t\t\tAND a.url_hash = b.url_hash\n\t\t\t\t\t\t\tAND a.fetched < b.fetched\n\t\t\t\t\tWHERE a.fetched > '" . $sStart . "'\n\t\t\t\t\t\tAND b.id IS NULL;\n\t\t\t");
     foreach ($aRows as $oRow) {
         $aIDs[] = $oRow->id;
     }
     return $aIDs;
 }