From 950ca1ce5ea81e0a25efcd9db59cb37c30ab2f32 Mon Sep 17 00:00:00 2001 From: merelendor Date: Mon, 18 Mar 2024 15:37:47 +0300 Subject: [PATCH 01/10] company legal address changed --- .gitignore | 3 +- about/requisites/index.php | 6 +- element_add.txt | 137 ++++++++---------- local/include/footer.php | 2 +- local/templates/evolution/css/forms/style.css | 3 + .../templates/evolution/css/forms/style.less | 4 + local/usedxml.php | 79 ++++++++++ 7 files changed, 153 insertions(+), 81 deletions(-) create mode 100644 local/usedxml.php diff --git a/.gitignore b/.gitignore index 7e6dc6b..d848c53 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ vkteamssetup.exe local/*.json local/*.txt local/commands/ -!local/sitemap.php \ No newline at end of file +!local/sitemap.php +element_add.txt \ No newline at end of file diff --git a/about/requisites/index.php b/about/requisites/index.php index f6eb6ea..9bb5581 100644 --- a/about/requisites/index.php +++ b/about/requisites/index.php @@ -43,7 +43,7 @@ $APPLICATION->SetTitle("Эволюция автолизинга: Реквизи

КПП

-

772401001

+

770501001

ОГРН

@@ -51,11 +51,11 @@ $APPLICATION->SetTitle("Эволюция автолизинга: Реквизи

Юридический адрес

-

115201, г. Москва, ул. Котляковская, дом 8, эт. 3, пом. 337

+

115054, г. Москва, вн. тер. г. муниципальный округ Замоскворечье, наб. Космодамианская, д. 52, стр. 5

Почтовый адрес

-

115201, г. Москва, ул. Котляковская, дом 8, эт. 3, пом. 337

+

115054, г. Москва, вн. тер. г. муниципальный округ Замоскворечье, наб. Космодамианская, д. 52, стр. 5

Банк

diff --git a/element_add.txt b/element_add.txt index 1f2f844..e66c8a7 100644 --- a/element_add.txt +++ b/element_add.txt @@ -1,107 +1,82 @@ array ( 'ACTIVE' => 'Y', 'MODIFIED_BY' => '1', - 'IBLOCK_ID' => 14, - 'ACTIVE_FROM' => '', + 'IBLOCK_ID' => 6, + 'ACTIVE_FROM' => '14.03.2024 11:37:00', 'ACTIVE_TO' => '', - 'SORT' => '2', - 'NAME' => 'Sollers Atlant', - 'CODE' => '', + 'SORT' => '500', + 'NAME' => 'Новый юридический адрес', + 'CODE' => 'novyy-yuridicheskiy-adres', 'TAGS' => '', 'PREVIEW_PICTURE' => array ( - 'name' => 'red-car.jpg', + 'name' => 'newadress.jpg', 'type' => 'image/jpeg', - 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-02-26/22/bxu/main/31779c4299b38fe66bd226bf54868991/file1708933784318/default', - 'size' => '49129', + 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-03-14/23/bxu/main/444dc44908c1b0cc73ddf2547ee7611b/file1710405603203/default', + 'size' => '190586', 'error' => 0, 'description' => '', 'COPY_FILE' => 'Y', 'MODULE_ID' => 'iblock', ), - 'PREVIEW_TEXT' => '
- Выгода до -
-

220 000 ₽

-

+ 'PREVIEW_TEXT' => 'А ещё у нас изменились КПП и адрес Центрального офиса', + 'PREVIEW_TEXT_TYPE' => 'text', + 'DETAIL_PICTURE' => + array ( + 'name' => 'newadress.jpg', + 'type' => 'image/jpeg', + 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-03-14/23/bxu/main/444dc44908c1b0cc73ddf2547ee7611b/file1710405543524/default', + 'size' => '190586', + 'error' => 0, + 'description' => '', + 'COPY_FILE' => 'Y', + 'MODULE_ID' => 'iblock', + ), + 'DETAIL_TEXT' => '

+ Эволюция не останавливается в своём стремительном развитии и переносит Центральный офис в один из самых известных офисных комплексов в центре Москвы – Riverside Towers.

-

+ Riverside Towers - один из первых крупнейших бизнес-центров в столице, является составной частью многофункционального общественного центра "Красные холмы" и располагается в 5 минутах от метро Павелецкая. +

+

+ В связи с этим у нас изменились юридический адрес и КПП. И теперь они выглядят так: +

+

+ Новый юридический адрес: 115054, г. Москва, вн. тер. г. муниципальный округ Замоскворечье, наб. Космодамианская, д. 52, стр. 5 +

+

+ Новый КПП: 770501001 +

+

+ Добро пожаловать! +

+

+

', - 'PREVIEW_TEXT_TYPE' => 'html', - 'DETAIL_TEXT' => '', - 'DETAIL_TEXT_TYPE' => 'text', + 'DETAIL_TEXT_TYPE' => 'html', 'TMP_ID' => 0, 'PROPERTY_VALUES' => array ( - 39 => - array ( - 'n0' => - array ( - 'VALUE' => 'Sollers', - ), - ), - 28 => + 159 => '', + 160 => array ( 'n0' => array ( 'VALUE' => '', ), ), - 32 => + 161 => array ( 'n0' => array ( - 'VALUE' => 'Выгода до 220 000 ₽', + 'VALUE' => '', ), ), - 27 => + 189 => array ( - 'n3' => - array ( - 'VALUE' => - array ( - 'name' => 'red-car.jpg', - 'type' => 'image/jpeg', - 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-02-26/22/bxu/main/31779c4299b38fe66bd226bf54868991/file1708933082416/default', - 'size' => '49129', - 'error' => 0, - ), - ), 'n0' => array ( - 'VALUE' => - array ( - 'name' => 'gal2.jpg', - 'type' => 'image/jpeg', - 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-02-26/22/bxu/main/31779c4299b38fe66bd226bf54868991/file1708933804999/default', - 'size' => '40669', - 'error' => 0, - ), - ), - 'n1' => - array ( - 'VALUE' => - array ( - 'name' => 'gal4.webp.jpg', - 'type' => 'image/jpeg', - 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-02-26/22/bxu/main/31779c4299b38fe66bd226bf54868991/file1708933211925/default', - 'size' => '38936', - 'error' => 0, - ), - ), - 'n2' => - array ( - 'VALUE' => - array ( - 'name' => 'gal6.jpg', - 'type' => 'image/jpeg', - 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-02-26/22/bxu/main/31779c4299b38fe66bd226bf54868991/file1708933384717/default', - 'size' => '29826', - 'error' => 0, - ), + 'VALUE' => '', ), ), ), @@ -118,11 +93,21 @@ array ( 'ELEMENT_DETAIL_PICTURE_FILE_TITLE' => '', 'ELEMENT_DETAIL_PICTURE_FILE_NAME' => '', ), - 'SEARCHABLE_CONTENT' => 'SOLLERS ATLANT -ВЫГОДА ДО 220 000 ₽ + 'SEARCHABLE_CONTENT' => 'НОВЫЙ ЮРИДИЧЕСКИЙ АДРЕС +А ЕЩЁ У НАС ИЗМЕНИЛИСЬ КПП И АДРЕС ЦЕНТРАЛЬНОГО ОФИСА +ЭВОЛЮЦИЯ НЕ ОСТАНАВЛИВАЕТСЯ В СВОЁМ СТРЕМИТЕЛЬНОМ +РАЗВИТИИ И ПЕРЕНОСИТ ЦЕНТРАЛЬНЫЙ ОФИС В ОДИН ИЗ САМЫХ ИЗВЕСТНЫХ ОФИСНЫХ КОМПЛЕКСОВ В ЦЕНТРЕ МОСКВЫ – RIVERSIDE TOWERS. - +RIVERSIDE TOWERS - ОДИН ИЗ ПЕРВЫХ КРУПНЕЙШИХ БИЗНЕС-ЦЕНТРОВ +В СТОЛИЦЕ, ЯВЛЯЕТСЯ СОСТАВНОЙ ЧАСТЬЮ МНОГОФУНКЦИОНАЛЬНОГО ОБЩЕСТВЕННОГО ЦЕНТРА "КРАСНЫЕ ХОЛМЫ" И РАСПОЛАГАЕТСЯ В 5 МИНУТАХ ОТ МЕТРО ПАВЕЛЕЦКАЯ. -- ПОЛНОПРИВОДНЫЙ ПИКАП -', +В СВЯЗИ С ЭТИМ У НАС ИЗМЕНИЛИСЬ ЮРИДИЧЕСКИЙ +АДРЕС И КПП. И ТЕПЕРЬ ОНИ ВЫГЛЯДЯТ ТАК: + +НОВЫЙ ЮРИДИЧЕСКИЙ АДРЕС: 115054, Г. МОСКВА, +ВН. ТЕР. Г. МУНИЦИПАЛЬНЫЙ ОКРУГ ЗАМОСКВОРЕЧЬЕ, НАБ. КОСМОДАМИАНСКАЯ, Д. 52, СТР. 5 + +НОВЫЙ КПП: 770501001 + +ДОБРО ПОЖАЛОВАТЬ!', ) \ No newline at end of file diff --git a/local/include/footer.php b/local/include/footer.php index ee6ea52..a8d9a4c 100644 --- a/local/include/footer.php +++ b/local/include/footer.php @@ -65,7 +65,7 @@
-

© ООО "ЛК Эволюция"
г. Москва, Котляковская ул., д. 8

+

© ООО "ЛК Эволюция"
115054, г. Москва, наб. Космодамианская, д. 52, стр. 5

Обработка персональных данных
diff --git a/local/templates/evolution/css/forms/style.css b/local/templates/evolution/css/forms/style.css index 208430f..d0891b1 100644 --- a/local/templates/evolution/css/forms/style.css +++ b/local/templates/evolution/css/forms/style.css @@ -814,3 +814,6 @@ .carrotquest-messenger-button-position { bottom: 60px!important; } +.carrotquest-messenger-right_bottom { + display: none; +} diff --git a/local/templates/evolution/css/forms/style.less b/local/templates/evolution/css/forms/style.less index cdf105b..3d6ad16 100644 --- a/local/templates/evolution/css/forms/style.less +++ b/local/templates/evolution/css/forms/style.less @@ -969,4 +969,8 @@ .carrotquest-messenger-button-position { bottom: 60px!important; +} + +.carrotquest-messenger-right_bottom { + display: none; } \ No newline at end of file diff --git a/local/usedxml.php b/local/usedxml.php new file mode 100644 index 0000000..4a5af2c --- /dev/null +++ b/local/usedxml.php @@ -0,0 +1,79 @@ +SetTitle("БУ фид"); + +$xmlbody = ''; +$i = 0; +$today = date("d.m.Y"); +CModule::IncludeModule("iblock"); + +// $arSelect = Array("ID", "NAME", "PROPERTY_CONTRACT", "PROPERTY_VEHICLE_TYPE","PROPERTY_VEHICLE_SUBTYPE","PROPERTY_BRAND","PROPERTY_MODEL", "PROPERTY_MODIFICATION","PROPERTY_VIN","PROPERTY_YEAR","PROPERTY_MILEAGE","PROPERTY_MILEAGE","PROPERTY_ENGINE_HOURS","PROPERTY_ENGINE_POWER","PROPERTY_ENGINE_VOLUME","PROPERTY_ENGINE_FUEL","PROPERTY_PARKING_CITY","PROPERTY_PARKING_REGION","PROPERTY_PRICE","PROPERTY_PRICE_WITH_DISCOUNT","PROPERTY_RESERVE_DATE","PROPERTY_SPECIAL_OFFER","PROPERTY_LEASING_AVAILABLE","PROPERTY_AFTER_ACCIDENT","PROPERTY_DESCRIPTION","PROPERTY_PHOTO","PROPERTY_PHOTOS_1080","PROPERTY_PHOTOS_480","PROPERTY_PHOTOS_120"); + +$arSelect = Array("ID", "NAME", "PROPERTY_CONTRACT", "PROPERTY_VEHICLE_TYPE","PROPERTY_VEHICLE_SUBTYPE","PROPERTY_BRAND","PROPERTY_MODEL", "PROPERTY_MODIFICATION","PROPERTY_VIN","PROPERTY_YEAR","PROPERTY_MILEAGE","PROPERTY_MILEAGE","PROPERTY_ENGINE_HOURS","PROPERTY_ENGINE_POWER","PROPERTY_ENGINE_VOLUME","PROPERTY_ENGINE_FUEL","PROPERTY_PARKING_CITY","PROPERTY_PARKING_REGION","PROPERTY_PRICE","PROPERTY_PRICE_WITH_DISCOUNT","PROPERTY_RESERVE_DATE","PROPERTY_SPECIAL_OFFER","PROPERTY_LEASING_AVAILABLE","PROPERTY_AFTER_ACCIDENT","PROPERTY_DESCRIPTION","PROPERTY_PHOTO"); + +$arFilter = Array("IBLOCK_ID"=>2, "ACTIVE"=>"Y"); + +$res = CIBlockElement::GetList(Array("SORT"=>"ASC"), $arFilter, false, Array("nPageSize"=>1000), $arSelect); + +while ($ob = $res->GetNextElement()) + { + $arFields = $ob->GetFields(); + $arFields['PROPERTIES'] = $ob->GetProperties(); + + $brand = CIBlockElement::GetByID($arFields["PROPERTY_BRAND_VALUE"]); + $ar_brand = $brand->GetNext(); + + $model = CIBlockElement::GetByID($arFields["PROPERTY_MODEL_VALUE"]); + $ar_model = $model->GetNext(); + + $mainfoto = CFile::GetPath($arFields["PROPERTY_PHOTO_VALUE"]); + + if ($arFields["PROPERTY_PRICE_WITH_DISCOUNT_VALUE"]!=0){ + $money = $arFields["PROPERTY_PRICE_WITH_DISCOUNT_VALUE"]; + } + else { + $money = $arFields["PROPERTY_PRICE_VALUE"]; + } + + $xmlbody .= ' + + '.$ar_brand['NAME'].' + '.$ar_model['NAME'].' + '.$arFields["PROPERTY_MODIFICATION_VALUE"].' + https://www.evoleasing.ru/izt/'.$arFields["PROPERTY_CONTRACT_VALUE"].'/ + в наличии + растаможен + '.$arFields["PROPERTY_MILEAGE_VALUE"].' + '.$arFields["PROPERTY_YEAR_VALUE"].' + '.$money.' + RUR + '.$arFields["PROPERTY_VIN_VALUE"].' + + https://www.evoleasing.ru'.$mainfoto.' + + '; + $i++; + // print $arFields["ID"]." => ".$arFields["NAME"]."
"; + ?>
 ".$arFields["NAME"]);
+	// print_r("mainfoto => ".$mainfoto);
+	?>
'; +?>
ссылке! ".$today; +} +?> + \ No newline at end of file From 846a7220fdd5dd45ceaee438952069ab17dbf928 Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 30 Apr 2024 16:14:40 +0300 Subject: [PATCH 02/10] updates for statistics data on about page --- about/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/about/index.php b/about/index.php index 5922bb4..35736dc 100644 --- a/about/index.php +++ b/about/index.php @@ -31,12 +31,12 @@ $APPLICATION->AddHeadString(' "ТОП 5", - "DEALS" => "> 100 млрд ₽", - "CONTRACTS" => "16 000+", + "DEALS" => "> 123 млрд ₽", + "CONTRACTS" => "24 000+", "CITIES" => "35", "PERIOD" => "> 10 лет", "DIVISIONS" => "61", - "CLIENTS" => "8 000+", + "CLIENTS" => "11 000+", ) ); ?> From b5b1c328bd73336d3311cb5e53002535294a8e2d Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 30 Apr 2024 16:29:23 +0300 Subject: [PATCH 03/10] zerof images loading updates & stats --- bitrix/php_interface/init.php | 96 ++++++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 25 deletions(-) diff --git a/bitrix/php_interface/init.php b/bitrix/php_interface/init.php index bb18f9b..5facf56 100644 --- a/bitrix/php_interface/init.php +++ b/bitrix/php_interface/init.php @@ -168,8 +168,12 @@ function OnEpilogHandler() \Bitrix\Main\Application::getInstance()->getExceptionHandler()->setHandlerOutput(new HttpExceptionHandlerOutput()); -function zerof_request($path, $query) +function zerof_request($path, $query, $timeout = 900) { + print "zerof_request | ".$path."\n"; + print_r($query); + print "\n"; + $key_sha1 = strtoupper(sha1(ZEROF_PASSWORD, false)); $date = gmdate('D, d M Y H:i:s T'); @@ -196,24 +200,44 @@ function zerof_request($path, $query) } $request = curl_init(); - curl_setopt($request, CURLOPT_TIMEOUT, 900); + curl_setopt($request, CURLOPT_TIMEOUT, $timeout); curl_setopt($request, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($request, CURLOPT_URL, $url); curl_setopt($request, CURLOPT_CONNECTTIMEOUT, 300); curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); curl_setopt($request, CURLOPT_HTTPHEADER, $headers); - $response = curl_exec($request) or die(curl_error($request)); + $response = curl_exec($request); $http_code = curl_getinfo($request, CURLINFO_HTTP_CODE); + print "ZEROF response code ".$http_code."\n"; + if($http_code != 200) + { + print_r($response); + print "\n"; + + $check = md5($path.var_export($query, true)); + $check_file = file_get_contents($_SERVER['DOCUMENT_ROOT']."/zerof-500.txt"); + if(strpos($check_file, $check) < 0) + { + file_put_contents($_SERVER['DOCUMENT_ROOT']."/zerof-500.txt", $path."\n".var_export($query, true)."\n".$http_code." | ".$response."\n\n"); + print "response with error logged\n"; + } + + print "\n"; + //die(); + } curl_close($request); + sleep(1); return $http_code === 200 ? $response : false; } function zerof_get_images($task_uid) { + print "zerof_get_images | ".$task_uid."\n"; $images = []; + $tasks_car_in_new = zerof_request("/v2/tasks/find", [ "status" => "new", "value" => $task_uid, "profile" => 703 ]); $tasks_car_in_process = zerof_request("/v2/tasks/find", [ "status" => "process", "value" => $task_uid, "profile" => 703 ]); $tasks_car_in_pass = zerof_request("/v2/tasks/find", [ "status" => "pass", "value" => $task_uid, "profile" => 703 ]); @@ -228,6 +252,13 @@ function zerof_get_images($task_uid) $tasks_trucks_in_pass_data = json_decode(html_entity_decode($tasks_trucks_in_pass), true); $tasks_trucks_in_new_data = json_decode(html_entity_decode($tasks_trucks_in_new), true); + $tasks_car_in_process_data = is_array($tasks_car_in_process_data) ? $tasks_car_in_process_data : []; + $tasks_car_in_pass_data = is_array($tasks_car_in_pass_data) ? $tasks_car_in_pass_data : []; + $tasks_car_in_new_data = is_array($tasks_car_in_new_data) ? $tasks_car_in_new_data : []; + $tasks_trucks_in_process_data = is_array($tasks_trucks_in_process_data) ? $tasks_trucks_in_process_data : []; + $tasks_trucks_in_pass_data = is_array($tasks_trucks_in_pass_data) ? $tasks_trucks_in_pass_data : []; + $tasks_trucks_in_new_data = is_array($tasks_trucks_in_new_data) ? $tasks_trucks_in_new_data : []; + $tasks = array_merge( $tasks_car_in_process_data[array_keys($tasks_car_in_process_data)[0]], $tasks_car_in_pass_data[array_keys($tasks_car_in_pass_data)[0]], @@ -238,34 +269,49 @@ function zerof_get_images($task_uid) ); print "\n".$task_uid." TASKS:\n"; - print_r($tasks[0]); - if(isset($tasks[0])) + + foreach($tasks AS $task_entry) { - $task_string = zerof_request("/v2/tasks/".$tasks[0]['id'], null); - $task = json_decode(html_entity_decode($task_string), true); - - print "TASK:\n"; - print_r($task); - - foreach($task['views'][0]['files'] AS $file) + if(trim($task_entry['title']) === trim($task_uid)) { - $image = zerof_request("/v2/tasks/downloadfile", [ "id" => $tasks[0]['id'], "name" => $file['name'] ]); - print_r("DOWNLOADED LEN OF IMAGE FILE: ".strlen($image)); + print_r($task_entry); + + $task_string = zerof_request("/v2/tasks/".$task_entry['id'], null); + $task = json_decode(html_entity_decode($task_string), true); + + print "TASK:\n"; + print_r($task); + + foreach($task['views'][0]['files'] AS $file) + { + $image = false; + $retry = 0; + while($image === false && $retry < 2) + { + $image = zerof_request("/v2/tasks/downloadfile", [ "id" => $task_entry['id'], "name" => $file['name'] ], 30); + $retry++; + } + print_r("DOWNLOADED LEN OF IMAGE FILE: ".strlen($image)); + print "\n"; + + if(strlen($image) < 100) + { + print "IMAGE ???? ".$image."\n\n"; + } + + if($image) + { + array_push($images, $image); + } + } + print "\n"; - if(strlen($image) < 100) - { - print "IMAGE ???? ".$image."\n\n"; - } - if($image) - { - array_push($images, $image); - } + break; } - - print "\n"; - print "\n"; } + + print "zerof_get_images | ".$task_uid." END\n"; print "\n"; return $images; From a75b75f402002d430a681cb2020e2428cedc4dbe Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 30 Apr 2024 17:32:52 +0300 Subject: [PATCH 04/10] API used cars total calculation update --- api/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/index.php b/api/index.php index 6c120a7..654937d 100644 --- a/api/index.php +++ b/api/index.php @@ -1477,7 +1477,7 @@ switch($PARAM_1) $filter['> "ASC", "NAME" => "ASC" ], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW ], $filter), [], []); + $total = CIBlockElement::GetList([ "SORT" => "ASC", "NAME" => "ASC" ], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW ], $filter), [], false, []); $result = [ "total" => $total, "possible_volumes" => [], @@ -1674,7 +1674,7 @@ switch($PARAM_1) } //filter for modifications - if(!empty($REQ['MODEL_ID'])) + if(!empty($REQ['MODEL_ID']) && !USED) { $filter_modifications = $filter; unset($filter_modifications['PROPERTY_MODIFICATION']); From 0467da1473b91f8811505a237beb8f2a0f3503ee Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 30 Apr 2024 17:45:11 +0300 Subject: [PATCH 05/10] used cars process update: add argument support for reload images --- local/used.php | 156 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 111 insertions(+), 45 deletions(-) diff --git a/local/used.php b/local/used.php index b4e564d..4bc8b6d 100644 --- a/local/used.php +++ b/local/used.php @@ -23,6 +23,9 @@ use Bitrix\Seo\SitemapRuntimeTable; Main\Loader::includeModule('seo'); +ob_get_clean(); +error_reporting(E_ERROR); + $arrContextOptions = [ "ssl" => [ "verify_peer"=>false, @@ -209,13 +212,13 @@ while($model_search_ob = $models_search_res->GetNextElement()) $bitrix_existed_models[] = $model_existed['ID']; } -print "bitrix_existed_models:\n"; -print_r($bitrix_existed_models); -print "\n\n"; +//print "bitrix_existed_models:\n"; +//print_r($bitrix_existed_models); +//print "\n\n"; -print "bitrix_models:\n"; -print_r($bitrix_models); -print "\n\n"; +//print "bitrix_models:\n"; +//print_r($bitrix_models); +//print "\n\n"; //добавляем новые марки из api @@ -226,7 +229,7 @@ foreach($api_data AS $brand_uid => $brand) $brand_element = new CIBlockElement; $brand_payload = [ "IBLOCK_ID" => IBLOCK_ID_BRANDS_USED, "NAME" => $brand['name'], "CODE" => $code, "PROPERTY_VALUES" => [ "UID" => $brand_uid ], "ACTIVE" => "Y", ]; - print $brand['name']." - ".$brand_uid."\n"; +// print $brand['name']." - ".$brand_uid."\n"; if($brand_new_id = $brand_element->Add($brand_payload)) { $bitrix_brands[ $brand_uid ] = $brand_new_id; @@ -243,11 +246,11 @@ foreach($api_data AS $brand_uid => $brand) $el->Update($brand_existed['ID'], ["ACTIVE" => "Y"]); } } - print "\n"; +// print "\n"; - print_r($brand['models']); - print "\n"; - print "\n"; +// print_r($brand['models']); +// print "\n"; +// print "\n"; //добавляем новые модели из api foreach($brand['models'] AS $model_uid => $model) @@ -273,12 +276,14 @@ foreach($api_data AS $brand_uid => $brand) $el->Update($model_existed['ID'], ["ACTIVE" => "Y"]); } } - print "\n"; +// print "\n"; } } function resize_image($image, $filename, $width, $height, $quality) { + print "resize_image ".$filename." | ".$width."x".$height."\n"; + $tempfile = tmpfile(); fwrite($tempfile, $image); $tempfile_metadata = stream_get_meta_data($tempfile); @@ -305,8 +310,12 @@ function resize_image($image, $filename, $width, $height, $quality) imagedestroy($resized); imagedestroy($panel); + print "resize_image | make file array\n"; + $file = CFile::MakeFileArray($tempfile_filename); $file['name'] = $filename.".".$ext; + print "resize_image | make file array\n"; + $saved_file_id = CFile::SaveFile($file, "used"); fclose($tempfile); @@ -314,6 +323,83 @@ function resize_image($image, $filename, $width, $height, $quality) return $saved_file_id; } +function set_images($code, $car_id, $delete = false, $properties = []) +{ + if($delete) + { + if($properties['PHOTO']['PROPERTY_VALUE_ID'] !== "") + { + CIBlockElement::SetPropertyValueCode($car_id, "PHOTO", [ $properties['PHOTO']['PROPERTY_VALUE_ID'] => [ "VALUE" => [ "MODULE_ID" => "iblock", "del" => "Y" ] ] ] ); + } + + if(is_array($properties['PHOTOS_1080']['PROPERTY_VALUE_ID']) && count($properties['PHOTOS_1080']['PROPERTY_VALUE_ID']) > 0) + { + $photos = []; + foreach($properties['PHOTOS_1080']['PROPERTY_VALUE_ID'] AS $k => $v) + { + $photos[ $v ] = [ "VALUE" => [ "MODULE_ID" => "iblock", "del" => "Y" ] ]; + } + CIBlockElement::SetPropertyValueCode($car_id, "PHOTOS_1080", $photos ); + } + + if(is_array($properties['PHOTOS_480']['PROPERTY_VALUE_ID']) && count($properties['PHOTOS_480']['PROPERTY_VALUE_ID']) > 0) + { + $photos = []; + foreach($properties['PHOTOS_480']['PROPERTY_VALUE_ID'] AS $k => $v) + { + $photos[ $v ] = [ "VALUE" => [ "MODULE_ID" => "iblock", "del" => "Y" ] ]; + } + CIBlockElement::SetPropertyValueCode($car_id, "PHOTOS_480", $photos ); + } + + if(is_array($properties['PHOTOS_120']['PROPERTY_VALUE_ID']) && count($properties['PHOTOS_120']['PROPERTY_VALUE_ID']) > 0) + { + $photos = []; + foreach($properties['PHOTOS_120']['PROPERTY_VALUE_ID'] AS $k => $v) + { + $photos[ $v ] = [ "VALUE" => [ "MODULE_ID" => "iblock", "del" => "Y" ] ]; + } + CIBlockElement::SetPropertyValueCode($car_id, "PHOTOS_120", $photos ); + } + } + + $images = zerof_get_images($code); + + if(count($images) > 0) + { + $photo_property_value = null; + $photos_1080_property_values = []; + $photos_480_property_values = []; + $photos_120_property_values = []; + + foreach($images AS $k => $image) + { + $saved_file_id_1080 = resize_image($image, $code."_".($k + 1)."_1080", 1440, 1080, 60); + $saved_file_id_480 = resize_image($image, $code."_".($k + 1)."_480", 640, 480, 60); + $saved_file_id_120 = resize_image($image, $code."_".($k + 1)."_120", 160, 120, 60); + + $photos_1080_property_values[] = [ "VALUE" => $saved_file_id_1080, ]; + $photos_480_property_values[] = [ "VALUE" => $saved_file_id_480, ]; + $photos_120_property_values[] = [ "VALUE" => $saved_file_id_120, ]; + + if($k === 0) + { + $photo_property_value = resize_image($image, $code."_".($k + 1)."_500", 500, 300, 60); + } + } + + print "set images | ".$code."\n"; + CIBlockElement::SetPropertyValueCode($car_id, "PHOTO", $photo_property_value); + CIBlockElement::SetPropertyValueCode($car_id, "PHOTOS_1080", $photos_1080_property_values); + CIBlockElement::SetPropertyValueCode($car_id, "PHOTOS_480", $photos_480_property_values); + CIBlockElement::SetPropertyValueCode($car_id, "PHOTOS_120", $photos_120_property_values); + } + + print "set_images END\n"; + + return; +} + $c = 0; foreach($json as $car) { @@ -369,36 +455,7 @@ foreach($json as $car) if($new_used_car_id = $used_car_element->Add($used_car_payload)) { //добавляем новое предложение в bitrix - $images = zerof_get_images($code); - - if(count($images) > 0) - { - $photo_property_value = null; - $photos_1080_property_values = []; - $photos_480_property_values = []; - $photos_120_property_values = []; - - foreach($images AS $k => $image) - { - $saved_file_id_1080 = resize_image($image, $code."_".($k + 1)."_1080", 1440, 1080, 60); - $saved_file_id_480 = resize_image($image, $code."_".($k + 1)."_480", 640, 480, 60); - $saved_file_id_120 = resize_image($image, $code."_".($k + 1)."_120", 160, 120, 60); - - $photos_1080_property_values[] = [ "VALUE" => $saved_file_id_1080, ]; - $photos_480_property_values[] = [ "VALUE" => $saved_file_id_480, ]; - $photos_120_property_values[] = [ "VALUE" => $saved_file_id_120, ]; - - if($k === 0) - { - $photo_property_value = resize_image($image, $code."_".($k + 1)."_500", 500, 300, 60); - } - } - - CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTO", $photo_property_value); - CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_1080", $photos_1080_property_values); - CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_480", $photos_480_property_values); - CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_120", $photos_120_property_values); - } + set_images($code, $new_used_car_id, false); print "\n"; } @@ -409,10 +466,16 @@ foreach($json as $car) while($car_search_ob = $cars_search_res->GetNextElement()) { $car_existed = $car_search_ob->GetFields(); + $car_existed['PROPERTIES'] = $car_search_ob->GetProperties(); $el = new CIBlockElement; $el->Update($car_existed['ID'], ["ACTIVE" => "Y", "NAME" => $name, "SORT" => 500]); + if(in_array("updateimages", $argv)) + { + set_images($code, $car_existed['ID'], true, $car_existed['PROPERTIES']); + } + CIBlockElement::SetPropertyValuesEx($car_existed['ID'], IBLOCK_ID_CATALOG_CARS_USED, $PROPERTY_VALUES, []); } } @@ -423,9 +486,10 @@ foreach($json as $car) //скрываем предложения, которые есть в bitrix но которых более нет в api foreach($bitrix_cars AS $code => $car_id) { - print "CAR ".$code." => ".$car_id."\n"; if(!in_array($code, $api_cars)) { + print "HIDE CAR ".$code." => ".$car_id."\n"; + $el = new CIBlockElement; $el->Update($car_id, ["ACTIVE" => "N", "SORT" => 1]); } @@ -434,9 +498,10 @@ foreach($bitrix_cars AS $code => $car_id) //скрываем марки, которые есть в bitrix но которых более нет в api foreach($bitrix_existed_brands AS $brand_id) { - print "BRAND ".$ibrand_idd."\n"; if(!in_array($brand_id, $api_existed_brands)) { + print "HIDE BRAND ".$ibrand_id."\n"; + $el = new CIBlockElement; $el->Update($brand_id, ["ACTIVE" => "N"]); } @@ -445,9 +510,10 @@ foreach($bitrix_existed_brands AS $brand_id) //скрываем модели, которые есть в bitrix но которых более нет в api foreach($bitrix_existed_models AS $model_id) { - print "MODEL ".$model_id."\n"; if(!in_array($model_id, $api_existed_models)) { + print "HIDE MODEL ".$model_id."\n"; + $el = new CIBlockElement; $el->Update($model_id, ["ACTIVE" => "N"]); } From 28702fb8391bfbf622508c3fb09f31f11528e966 Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 30 Apr 2024 17:48:21 +0300 Subject: [PATCH 06/10] footer update for antifraud link --- local/include/footer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/local/include/footer.php b/local/include/footer.php index a8d9a4c..7efa8bb 100644 --- a/local/include/footer.php +++ b/local/include/footer.php @@ -72,6 +72,9 @@ + From f0859a901a292d69115ac7e9ccde6e0192b26222 Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 30 Apr 2024 17:49:17 +0300 Subject: [PATCH 07/10] highlights component update for marketing data --- .../evolution/about.highlights/templates/.default/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local/components/evolution/about.highlights/templates/.default/template.php b/local/components/evolution/about.highlights/templates/.default/template.php index 5f962b6..3f456d2 100644 --- a/local/components/evolution/about.highlights/templates/.default/template.php +++ b/local/components/evolution/about.highlights/templates/.default/template.php @@ -58,7 +58,7 @@ $this->setFrameMode(true); stroke="white" stroke-width="2" />

-

В России по лизингу легковых автомобилей по рэнкингу Эксперт РА по результатам 2022 года

+

В России по лизингу легковых автомобилей для МСБ по рэнкингу Эксперт РА по результатам 2023 года

From 9df5e26b15b37c6c9f5cdf95619384e590c62570 Mon Sep 17 00:00:00 2001 From: merelendor Date: Thu, 2 May 2024 15:46:47 +0300 Subject: [PATCH 08/10] remove yasprav from git --- cron/yasprav.php | 101 ------------------------------------------ element_add.txt | 113 ----------------------------------------------- 2 files changed, 214 deletions(-) delete mode 100644 cron/yasprav.php delete mode 100644 element_add.txt diff --git a/cron/yasprav.php b/cron/yasprav.php deleted file mode 100644 index d21cf37..0000000 --- a/cron/yasprav.php +++ /dev/null @@ -1,101 +0,0 @@ - -'; -$i = 0; -$today = date("d.m.Y"); -CModule::IncludeModule("iblock"); -$arSelect = Array("ID", "NAME", "PROPERTY_PHONE", "PROPERTY_PHONE_CENTRAL","PROPERTY_ADDRESS","PROPERTY_HOURS","PROPERTY_GEO", "PROPERTY_YAADRESS1","PROPERTY_YAADRESS2","PROPERTY_YADATA","PROPERTY_YAID",); -$arFilter = Array("IBLOCK_ID"=>5, "ACTIVE"=>"Y"); - -$res = CIBlockElement::GetList(Array("SORT"=>"ASC"), $arFilter, false, Array("nPageSize"=>333), $arSelect); - -while($ob = $res->GetNextElement()) -{ - $arFields = $ob->GetFields(); - - $geo = explode(",", $arFields["PROPERTY_GEO_VALUE"]); - - $xmlbody .= ' - '.$arFields["PROPERTY_YAID_VALUE"].' - Эволюция Автолизинга - ЛК Эволюция -
'.$arFields["PROPERTY_YAADRESS1_VALUE"].'
- Россия - '.$arFields["PROPERTY_YAADRESS2_VALUE"].' - - '.$arFields["PROPERTY_PHONE_VALUE"].' - Горячая линия - phone - - buy@evoleasing.ru - https://www.evoleasing.ru - https://t.me/evoleasingru - https://vk.com/evoleasing - https://www.evoleasing.ru/about/contacts/ - пн-пт 9:00-18:00 - - 01.01.2024 - - - 02.01.2024 - - - 03.01.2024 - - - 04.01.2024 - - - 05.01.2024 - - - 06.01.2024 - - - 07.01.2024 - - - 08.01.2024 - - 184105576 - 9724016636 - 1207700245037 - '.$today.' - - - - - '.$geo[1].' - '.$geo[0].' - -
- '; -?>
 ".$arFields["PROPERTY_YAID_VALUE"]);
-?>
'; -?>
ссылке! ".$today; -} -?> - diff --git a/element_add.txt b/element_add.txt deleted file mode 100644 index e66c8a7..0000000 --- a/element_add.txt +++ /dev/null @@ -1,113 +0,0 @@ -array ( - 'ACTIVE' => 'Y', - 'MODIFIED_BY' => '1', - 'IBLOCK_ID' => 6, - 'ACTIVE_FROM' => '14.03.2024 11:37:00', - 'ACTIVE_TO' => '', - 'SORT' => '500', - 'NAME' => 'Новый юридический адрес', - 'CODE' => 'novyy-yuridicheskiy-adres', - 'TAGS' => '', - 'PREVIEW_PICTURE' => - array ( - 'name' => 'newadress.jpg', - 'type' => 'image/jpeg', - 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-03-14/23/bxu/main/444dc44908c1b0cc73ddf2547ee7611b/file1710405603203/default', - 'size' => '190586', - 'error' => 0, - 'description' => '', - 'COPY_FILE' => 'Y', - 'MODULE_ID' => 'iblock', - ), - 'PREVIEW_TEXT' => 'А ещё у нас изменились КПП и адрес Центрального офиса', - 'PREVIEW_TEXT_TYPE' => 'text', - 'DETAIL_PICTURE' => - array ( - 'name' => 'newadress.jpg', - 'type' => 'image/jpeg', - 'tmp_name' => '/home/bitrix/.bx_temp/sitemanager/BXTEMP-2024-03-14/23/bxu/main/444dc44908c1b0cc73ddf2547ee7611b/file1710405543524/default', - 'size' => '190586', - 'error' => 0, - 'description' => '', - 'COPY_FILE' => 'Y', - 'MODULE_ID' => 'iblock', - ), - 'DETAIL_TEXT' => '

- Эволюция не останавливается в своём стремительном развитии и переносит Центральный офис в один из самых известных офисных комплексов в центре Москвы – Riverside Towers. -

-

- Riverside Towers - один из первых крупнейших бизнес-центров в столице, является составной частью многофункционального общественного центра "Красные холмы" и располагается в 5 минутах от метро Павелецкая. -

-

- В связи с этим у нас изменились юридический адрес и КПП. И теперь они выглядят так: -

-

- Новый юридический адрес: 115054, г. Москва, вн. тер. г. муниципальный округ Замоскворечье, наб. Космодамианская, д. 52, стр. 5 -

-

- Новый КПП: 770501001 -

-

- Добро пожаловать! -

-

-
-

', - 'DETAIL_TEXT_TYPE' => 'html', - 'TMP_ID' => 0, - 'PROPERTY_VALUES' => - array ( - 159 => '', - 160 => - array ( - 'n0' => - array ( - 'VALUE' => '', - ), - ), - 161 => - array ( - 'n0' => - array ( - 'VALUE' => '', - ), - ), - 189 => - array ( - 'n0' => - array ( - 'VALUE' => '', - ), - ), - ), - 'IPROPERTY_TEMPLATES' => - array ( - 'ELEMENT_META_TITLE' => '', - 'ELEMENT_META_KEYWORDS' => '', - 'ELEMENT_META_DESCRIPTION' => '', - 'ELEMENT_PAGE_TITLE' => '', - 'ELEMENT_PREVIEW_PICTURE_FILE_ALT' => '', - 'ELEMENT_PREVIEW_PICTURE_FILE_TITLE' => '', - 'ELEMENT_PREVIEW_PICTURE_FILE_NAME' => '', - 'ELEMENT_DETAIL_PICTURE_FILE_ALT' => '', - 'ELEMENT_DETAIL_PICTURE_FILE_TITLE' => '', - 'ELEMENT_DETAIL_PICTURE_FILE_NAME' => '', - ), - 'SEARCHABLE_CONTENT' => 'НОВЫЙ ЮРИДИЧЕСКИЙ АДРЕС -А ЕЩЁ У НАС ИЗМЕНИЛИСЬ КПП И АДРЕС ЦЕНТРАЛЬНОГО ОФИСА -ЭВОЛЮЦИЯ НЕ ОСТАНАВЛИВАЕТСЯ В СВОЁМ СТРЕМИТЕЛЬНОМ -РАЗВИТИИ И ПЕРЕНОСИТ ЦЕНТРАЛЬНЫЙ ОФИС В ОДИН ИЗ САМЫХ ИЗВЕСТНЫХ ОФИСНЫХ КОМПЛЕКСОВ В ЦЕНТРЕ МОСКВЫ – RIVERSIDE TOWERS. - -RIVERSIDE TOWERS - ОДИН ИЗ ПЕРВЫХ КРУПНЕЙШИХ БИЗНЕС-ЦЕНТРОВ -В СТОЛИЦЕ, ЯВЛЯЕТСЯ СОСТАВНОЙ ЧАСТЬЮ МНОГОФУНКЦИОНАЛЬНОГО ОБЩЕСТВЕННОГО ЦЕНТРА "КРАСНЫЕ ХОЛМЫ" И РАСПОЛАГАЕТСЯ В 5 МИНУТАХ ОТ МЕТРО ПАВЕЛЕЦКАЯ. - -В СВЯЗИ С ЭТИМ У НАС ИЗМЕНИЛИСЬ ЮРИДИЧЕСКИЙ -АДРЕС И КПП. И ТЕПЕРЬ ОНИ ВЫГЛЯДЯТ ТАК: - -НОВЫЙ ЮРИДИЧЕСКИЙ АДРЕС: 115054, Г. МОСКВА, -ВН. ТЕР. Г. МУНИЦИПАЛЬНЫЙ ОКРУГ ЗАМОСКВОРЕЧЬЕ, НАБ. КОСМОДАМИАНСКАЯ, Д. 52, СТР. 5 - -НОВЫЙ КПП: 770501001 - -ДОБРО ПОЖАЛОВАТЬ!', -) \ No newline at end of file From 3568349b000a6f174e5a1bf9fbe1be156732cbb5 Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 14 May 2024 20:41:19 +0300 Subject: [PATCH 09/10] fix for last admin detection & user deletion --- api/index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/index.php b/api/index.php index 08327f4..fe6f366 100644 --- a/api/index.php +++ b/api/index.php @@ -284,7 +284,15 @@ function setCompanyForUser($ID, $REQ, $replace = false) помечаем админов на удаление из этой компании */ - $admins_to_remove = $existed_client_record['PROPERTIES']['ADMINS']['VALUE']; + $current_admins = $existed_client_record['PROPERTIES']['ADMINS']['VALUE']; + + foreach($current_admins AS $ca_id) + { + if(intval($ID) !== intval($ca_id)) + { + array_push($admins_to_remove, $ca_id); + } + } } else { From ea37a51f113447102b15a925d41f4e2fad7a50de Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 14 May 2024 20:42:24 +0300 Subject: [PATCH 10/10] PHP 8.3 fix for non defined variables --- .../templates/.default/template.php | 34 ++++++++--------- .../templates/.default/template.php | 30 +++++++-------- .../templates/.default/template.php | 30 +++++++-------- .../templates/.default/template.php | 37 +++++++++++-------- 4 files changed, 67 insertions(+), 64 deletions(-) diff --git a/local/components/evolution/programs.aggregations.brands.list/templates/.default/template.php b/local/components/evolution/programs.aggregations.brands.list/templates/.default/template.php index 3aee193..2e58b8d 100644 --- a/local/components/evolution/programs.aggregations.brands.list/templates/.default/template.php +++ b/local/components/evolution/programs.aggregations.brands.list/templates/.default/template.php @@ -12,26 +12,24 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> - -
-

-
- -
- - <?= $brand['NAME']; ?> - -
- - -
- - Другие бренды + 0): ?> + \ No newline at end of file diff --git a/local/components/evolution/programs.aggregations.offers.list/templates/.default/template.php b/local/components/evolution/programs.aggregations.offers.list/templates/.default/template.php index 72c4c1d..9093ef2 100644 --- a/local/components/evolution/programs.aggregations.offers.list/templates/.default/template.php +++ b/local/components/evolution/programs.aggregations.offers.list/templates/.default/template.php @@ -13,21 +13,19 @@ $this->setFrameMode(true); ?> Спецпредложения и акции на тракторы в лизинг*/?> - 0): ?> - -
-

Популярная специальная техника в лизинг

-
- - - -
+ 0): ?> +
+

Популярная специальная техника в лизинг

+
+ + +
- +
\ No newline at end of file diff --git a/local/components/evolution/programs.aggregations.types/templates/.default/template.php b/local/components/evolution/programs.aggregations.types/templates/.default/template.php index c12067c..c9e5ebe 100644 --- a/local/components/evolution/programs.aggregations.types/templates/.default/template.php +++ b/local/components/evolution/programs.aggregations.types/templates/.default/template.php @@ -12,25 +12,25 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - 0): ?> - -
-

-
- -
-

-
    + 0): ?> +
    +

    +
    + +
    +

    + - <?= $section['NAME']; ?> -
    - -
    + +
+ <?= $section['NAME']; ?> +
+
- +
\ No newline at end of file diff --git a/local/components/evolution/programs.aggregations/templates/.default/template.php b/local/components/evolution/programs.aggregations/templates/.default/template.php index 01da63e..803c0c6 100644 --- a/local/components/evolution/programs.aggregations/templates/.default/template.php +++ b/local/components/evolution/programs.aggregations/templates/.default/template.php @@ -194,24 +194,31 @@ $this->setFrameMode(true); ) ); ?> - - -
-

Преимущества работы с компанией “Эволюция”

-
-
-

Таким образом, внедрение современных методик требует определения и уточнения новых предложений! В рамках спецификации современных стандартов, действия представителей оппозиции, инициированные исключительно синтетически, преданы социально-демократической анафеме.

-

Однозначно, ключевые особенности структуры проекта лишь добавляют фракционных разногласий и объективно рассмотрены соответствующими инстанциями. Не следует, однако, забывать, что разбавленное изрядной долей эмпатии, рациональное мышление выявляет срочную потребность дальнейших направлений развития.

-

Однозначно, акционеры крупнейших компаний, вне зависимости от их уровня, должны быть в равной степени предоставлены сами себе. Безусловно, понимание сути ресурсосберегающих технологий однозначно фиксирует необходимость стандартных подходов. Современные технологии достигли такого уровня, что начало повседневной работы по формированию позиции создаёт необходимость включения в производственный план целого ряда внеочередных мероприятий с учётом комплекса благоприятных перспектив.

-
-
- + + + +
+
+ Преимущества + */?> +

+
+
+ +
+ +
+ <?= $arResult['NAME']; ?> +
+
-
- + + + - + IncludeComponent( "evolution:form.leasing",