Commit 162f8ca7 authored by Kulya's avatar Kulya 😊

Upd alvbx add Products Synch Changed

parent 5270965a
......@@ -563,6 +563,8 @@ class AloVoiceRest
];
echo "Загрузка данных из Billz...";
$sdata = self::get_products_last_update(); //"2017-01-01T00:00:00Z";
$first = BillzRest::getProducts($sdata);
......@@ -574,9 +576,24 @@ class AloVoiceRest
}
}
$prdAllCnd = count($first["answer"]["result"]);
echo "Загружено ".$prdAllCnd." товаров!";
echo "Импортирования в Тарговый каталог...";
foreach($first["answer"]["result"] as $prd){
$this->bx_process_product($prd);
$newProductsCnt++;
$percStp = round(($newProductsCnt/$prdAllCnd)*100);
$nowt = time();
$raznt = $nowt-$tms["0_begin"];
$remainTime = 0;
if($raznt!=0 && $percStp!=0) { $remainTime = round(($raznt/$percStp)*100); }
echo "\r Импортировано: \033[32m".$percStp."% \033[0m [\033[36m".$loadedCnt."\033[0m/".$totalCnt."] [Прошло: ".$raznt." сек.]...";
}
self::set_products_last_update();
......@@ -620,8 +637,8 @@ class AloVoiceRest
$arConf["billz_productfields"] = $arAllProperties;
self::save_billzconf(["conf"=>$arConf]);
$tms["2_end"] = time();
$alltime = $tms["3_end"]-$tms["0_begin"];
$now = time();
$alltime = $now-$tms["0_begin"];
$return = ["newproducts"=>$newProductsCnt,"billzprops"=>count($arAllProperties), "time"=>$alltime."sec."]; //"categories"=>$arSections, "subcats"=>$arSubSections, "trdcats"=>$arTrdSections, "offices"=>$arOffices,
ALVC::eLog($return,"------ AloVoiceRest :: billz_catalog_infos_synch CRON Done!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment