Свойства заказа
Получение списка свойств заказа, привязанных к платежной системе и службе доставки:
$dbRes = \Bitrix\Sale\Property::getList([ 'select' => ['ID'], 'filter' => [ 'REL_PS.ENTITY_ID' => 184, 'REL_DLV.ENTITY_ID' => 1, ], 'runtime' => [ new \Bitrix\Main\Entity\ReferenceField( 'REL_PS', '\Bitrix\Sale\Internals\OrderPropsRelationTable', array("=ref.PROPERTY_ID" => "this.ID", "=ref.ENTITY_TYPE" => new \Bitrix\Main\DB\SqlExpression('?', 'P')), array("join_type"=>"left") ), new \Bitrix\Main\Entity\ReferenceField( 'REL_DLV', '\Bitrix\Sale\Internals\OrderPropsRelationTable', array("=this.ID" => "ref.PROPERTY_ID", "=ref.ENTITY_TYPE" => new \Bitrix\Main\DB\SqlExpression('?', 'D')), array("join_type"=>"left") ), ], 'group' => ['ID'], 'order' => ['ID' => 'DESC'] ]); while ($property = $dbRes->fetch()) { var_dump($property); }
© «Битрикс», 2001-2024, «1С-Битрикс», 2024