SHARE
TWEET

Untitled

a guest Oct 18th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top