Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public function getLatestArtifactsCount($numDayInterval = 3) {
  2. $strQ = <<<EOF
  3. SELECT COUNT(id) FROM artifacts.item
  4. WHERE
  5. add_timestamp >= (current_date - :day_interval)::timestamp AND
  6. is_imported = FALSE AND
  7. is_public = TRUE AND
  8. is_removed = FALSE;
  9. EOF;
  10.  
  11. $objSth = $this->objDb->prepare($strQ);
  12. $objSth->execute(array(
  13. ':day_interval' => $numDayInterval
  14. ));
  15. $numArtifactsCount = $objSth->fetchColumn();
  16. return $numArtifactsCount;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement