1
0

BxIntercomDb.php 810 B

1234567891011121314151617181920212223242526272829303132
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Intercom Intercom integration module
  7. * @ingroup UnaModules
  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. /** @} */