Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
connectororder.php
1<?
2
4
6
7if (!Loader::includeModule('sender'))
8{
9 return;
10}
11
12class ConnectorOrder extends \Bitrix\Sender\Connector
13{
14 public function getName()
15 {
16 return 'Sale - orders';
17 }
18
19 public function getCode()
20 {
21 return "order";
22 }
23
24
26 public function getData()
27 {
28 $runtime = array();
29 $filter = array();
30
31 if($this->getFieldValue('LID'))
32 $filter['=LID'] = $this->getFieldValue('LID', null);
33
34 if($this->getFieldValue('ID'))
35 $filter['=ID'] = $this->getFieldValue('ID', 0);
36
37 if($this->getFieldValue('USER_ID'))
38 $filter['=USER_ID'] = $this->getFieldValue('USER_ID', 0);
39
40 if($this->getFieldValue('BASKET_PRODUCT_ID'))
41 {
42 $filter['=BASKET.PRODUCT_ID'] = $this->getFieldValue('BASKET_PRODUCT_ID', 0);
43 $runtime['BASKET'] = array(
44 'data_type' => 'Bitrix\Sale\Internals\Basket',
45 'reference' => array(
46 '=this.ID' => 'ref.ORDER_ID'
47 )
48 );
49 }
50
51 $resultDb = \Bitrix\Sale\Internals\OrderTable::getList(array(
52 'select' => array('USER_ID', 'NAME' => 'USER.NAME', 'EMAIL' => 'USER.EMAIL'),
53 'filter' => $filter,
54 'runtime' => $runtime,
55 'group' => array('USER_ID', 'NAME', 'EMAIL'),
56 'order' => array('USER_ID' => 'ASC'),
57 ));
58
59 return new \CDBResult($resultDb);
60 }
61
62 public function getForm()
63 {
64 return '';
65 }
66
67}