Your IP : 18.188.118.154
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php");
$postData = file_get_contents('php://input');
$data = json_decode($postData, true);
$series = $data['series'];
$area_min = $data['min'];
$area_max = $data['max'];
$area_min = (int)$area_min;
$area_max = (int)$area_max;
$products_id = array(38617, 8187, 12518, 12517, 38611, 8188, 12515, 12516);
if($area_max >= 30){
$area_max = '30';
$area_min = '15';
}elseif($area_max <= 15){
$area_max = '30';
$area_min = '15';
}
$arSelect = Array("ID", "NAME", "PROPERTY_filter_00282","PROPERTY_series","CATALOG_GROUP_1");
$arFilter = Array("IBLOCK_ID"=>62, "ID"=> $products_id, "ACTIVE"=>"Y", "PROPERTY_series" => $series, ">=PROPERTY_filter_00282" => $area_min, "<=PROPERTY_filter_00282" => $area_max,);
$res = CIBlockElement::GetList(Array("PROPERTY_filter_00282" => 'ASC'), $arFilter, false, false, $arSelect);
while($ob = $res->GetNextElement())
{
$arFields = $ob->GetFields();
$mass[] = $arFields;
}
foreach ($mass as $key => $item){
$goods[$key]['name']= $item['NAME'];
$goods[$key]['square']= $item['PROPERTY_FILTER_00282_VALUE'];
$goods[$key]['price']= $item['CATALOG_PRICE_1'];
}
$arSelectq = Array("ID", "NAME", "CATALOG_GROUP_1");
$arFilterq = Array("IBLOCK_ID"=>62, "ID"=> 38497, "ACTIVE"=>"Y");
$resq = CIBlockElement::GetList(Array(), $arFilterq, false, false, $arSelectq);
while($obq = $resq->GetNextElement())
{
$arFieldsq = $obq->GetFields();
$controller[0]['name'] = $arFieldsq['NAME'];
$controller[0]['price'] = $arFieldsq['CATALOG_PRICE_1'];
}
$result['goods'] = $goods;
$result['controller'] = $controller;
header('Content-Type: application/json');
echo json_encode($result);