ZardoZAntony

Выбор заказов за промежуток времени, Bitrix D7

Dec 7th, 2020 (edited)
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. \Bitrix\Main\Loader::includeModule('sale');
  2.  
  3. $from = new DateTime('03.10.2017 05:20:20');
  4. $to = new DateTime('11.10.2017 22:00:00');
  5.  
  6. $arQueryParams = [
  7.     'select' => ['*'],
  8.     'filter' => [
  9.         ['>=DATE_INSERT' => $from->format('d.m.Y H:i:s')],
  10.         ['<=DATE_INSERT' => $to->format('d.m.Y H:i:s')]
  11.     ]
  12. ];
  13.  
  14. $obj =  \Bitrix\Sale\Order::getList($arQueryParams);
  15.  
  16. $result = [];
  17. while ($r = $obj->fetch()) {
  18.     $result[] = $r;
  19. }
  20.  
  21. print_r($result);
Add Comment
Please, Sign In to add comment