Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2.  
  3. \Bitrix\Main\Loader::includeModule('timeman');
  4.  
  5. use Bitrix\Timeman\Model\EntriesTable;
  6.  
  7. $filter = array(
  8. '>DATE_START' => (new \Bitrix\Main\Type\DateTime())->setTime(0, 0, 0),
  9. array(
  10. 'LOGIC' => 'OR',
  11. '<DATE_FINISH' => (new \Bitrix\Main\Type\DateTime())->setTime(23, 55, 0),
  12. 'DATE_FINISH' => false
  13. )
  14. );
  15.  
  16. $select = array(
  17. 'NAME' => 'USER.NAME',
  18. 'LAST_NAME' => 'USER.LAST_NAME',
  19. 'USER_ID'
  20. );
  21.  
  22. $userRef = (
  23. new Bitrix\Main\ORM\Fields\Relations\Reference(
  24. 'USER',
  25. \Bitrix\Main\UserTable::class,
  26. \Bitrix\Main\ORM\Query\Join::on('this.USER_ID', 'ref.ID')
  27. )
  28. )->configureJoinType('inner');
  29.  
  30. $dbEntries = EntriesTable::getList(array(
  31. 'runtime' => array(
  32. $userRef
  33. ),
  34. 'filter' => $filter,
  35. 'select' => $select
  36. ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement