#D7 — МиниКод http://minicode.ru записи кодов Wed, 05 Sep 2018 06:40:48 +0000 ru-RU hourly 1 https://wordpress.org/?v=4.8.14 D7 Работа с ExpressionField в getList http://minicode.ru/d7-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0-%d1%81-expressionfield-%d0%b2-getlist/ Mon, 10 Oct 2016 12:28:06 +0000 http://minicode.ru/?p=952

$resOrder = Bitrix\Sale\OrderTable::getList(
    array(
        'filter' => array('=USER_ID' => 1),
        'group' => array('PAYED'),
        'runtime' => array(           
            new Bitrix\Main\Entity\ExpressionField('IDS', 'GROUP_CONCAT(%s)', array('ID')),
        ),
    )
);

]]>
Bitrix d7 получить список пользователей по группам http://minicode.ru/bitrix-d7-%d0%bf%d0%be%d0%bb%d1%83%d1%87%d0%b8%d1%82%d1%8c-%d1%81%d0%bf%d0%b8%d1%81%d0%be%d0%ba-%d0%bf%d0%be%d0%bb%d1%8c%d0%b7%d0%be%d0%b2%d0%b0%d1%82%d0%b5%d0%bb%d0%b5%d0%b9-%d0%bf%d0%be-%d0%b3%d1%80/ Wed, 10 Aug 2016 08:33:23 +0000 http://minicode.ru/?p=949
           $arUsers = Bitrix\Main\UserGroupTable::getList(
		array(
			'order'=>array('USER_ID' => 'asc'),
			'group'=>array('USER_ID'),
			'select' => array(
				'USER_ID',
				'USER_DATE_REGISTER' => 'USER.DATE_REGISTER',
				'USER_ACTIVE' => 'USER.ACTIVE',
				'USER_EMAIL' => 'USER.EMAIL',
				'USER_LOGIN' => 'USER.LOGIN',
				'USER_WORK_COMPANY' => 'USER.WORK_COMPANY',
				'USER_NAME' => 'USER.NAME',
				'USER_GROUP_STR',
			),
			'filter' => array(
				'GROUP.ACTIVE' => 'Y',
				'USER.ACTIVE' => 'Y',
				'GROUP_ID' => array(3, 4),
				array(
					'LOGIC' => 'OR',
					'=DATE_ACTIVE_FROM' => null,
					'<=DATE_ACTIVE_FROM' => $nowTimeExpression,
				),
				array(
					'LOGIC' => 'OR',
					'=DATE_ACTIVE_TO' => null,
					'>=DATE_ACTIVE_TO' => $nowTimeExpression,
				),
			),
			'runtime' => array(
				'USER_GROUP_STR' => array(
					'data_type' => 'string',
					'expression' => array('GROUP_CONCAT(%s)', 'GROUP_ID')
				),

			)
		)
	)->fetchAll();
]]>
Bitrix d7 getList runtime http://minicode.ru/bitrix-d7-getlist-runtime/ Wed, 27 Jul 2016 14:14:58 +0000 http://minicode.ru/?p=943 Два разных способа записи runtime сущностей

            if(!class_exists('Bitrix\Sale\Internals\OrderPropsValueTable')){
                CModule::AddAutoloadClasses(
                    "",
                    array(
                        'Bitrix\Sale\Internals\OrderPropsValueTable' => "/bitrix/modules/sale/distr/lib/internals/orderprops_value.php",
                        'Bitrix\Sale\Internals\OrderPropsTable' => "/bitrix/modules/sale/distr/lib/internals/orderprops.php",
                    )
                );
            }

            $arOrder = Bitrix\Sale\OrderTable::getRow(
                array(
                    'filter' => array(
                        '=ID' => 36835, 'LID' => 's1'
                    ),
                    'select' => array(
                        'ID', 'PRICE',
                        'ADDRESS' => 'ADDRESS_ORDER.VALUE'
                    ),
                    'runtime' => array(
                        'ADDRESS_ORDER' => array(
                            'data_type' => 'Bitrix\Sale\Internals\OrderPropsValueTable',
                            'reference' => array(
                                '=ref.CODE' => new Bitrix\Main\DB\SqlExpression('?s', 'ADDRESS'),
                                '=this.ID' => 'ref.ORDER_ID',
                            )
                        ),
                        new Bitrix\Main\Entity\ReferenceField(
                            'ADDRESS_ORDER',
                            'Bitrix\Sale\Internals\OrderPropsValueTable',
                            array(
                                '=ref.CODE' => new Bitrix\Main\DB\SqlExpression('?s', 'ADDRESS'),
                                '=this.ID' => 'ref.ORDER_ID',
                            )
                        )
                    )
                )
            );
]]>