Merge pull request #45 from Frosin/master

fixed incorrect response processing bug in RetailcrmHistory
This commit is contained in:
Alex Lushpai 2019-07-18 12:59:13 +03:00 committed by GitHub
commit d2b3299329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ class RetailcrmHistory
$history = self::$api->customersHistory($filter);
if ($history->isSuccessful() && count($history->history)) {
if ($history && count($history->history)) {
$historyChanges = $history->history;
$end = end($historyChanges);
$sinceid = $end['id'];
@ -167,7 +167,7 @@ class RetailcrmHistory
$orderFix = array();
$history = self::$api->ordersHistory($filter);
if ($history->isSuccessful() && count($history->history) > 0) {
if ($history && count($history->history) > 0) {
$historyChanges = $history->history;
$end = end($historyChanges);
$sinceId = $end['id'];
@ -187,7 +187,7 @@ class RetailcrmHistory
if (!array_key_exists('externalId', $order_history)) {
$responce = self::$api->ordersGet($order_history['id'], 'id');
if ($responce->isSuccessful()) {
if ($responce) {
$order = $responce['order'];
} else {
continue;