BxIntercomDb.php 842 B

1234567891011121314151617181920212223242526272829303132
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup Intercom Intercom integration module
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. class BxIntercomDb extends BxDolModuleDb
  12. {
  13. function __construct(&$oConfig)
  14. {
  15. parent::__construct($oConfig);
  16. }
  17. public function getInitialUsers($iLimit = 1000)
  18. {
  19. return $this->getColumn("SELECT `id` FROM `sys_accounts` ORDER BY `added` DESC LIMIT " . (int)$iLimit);
  20. }
  21. public function getSessionRowByAccountId($iAccountId)
  22. {
  23. return $this->getRow("SELECT * FROM `sys_sessions` WHERE `user_id` = :account ORDER BY `date` DESC LIMIT 1", array(
  24. 'account' => $iAccountId,
  25. ));
  26. }
  27. }
  28. /** @} */