Схема
public mixed
getProductErrors (
$product_id, $version = 2 )
Аргументы
| Аргумент |
Возможный тип |
Описание |
| $product_id |
— |
— |
| $version = 2 |
— |
— |
Описание
Метод пока еще не документирован.
Исходный код
if($version == 3) {
$messageRow = $this->db->query("
SELECT `messages` FROM `" . DB_PREFIX . "amazonus_product`
WHERE `product_id` = '" . (int)$product_id . "' AND `version` = 3")->row;
return json_decode($messageRow['messages']);
}
$result = array();
$insertionRows = $this->db->query("
SELECT `sku`, `insertion_id` FROM `" . DB_PREFIX . "amazonus_product`
WHERE `product_id` = '" . (int)$product_id . "' AND `version` = 2")->rows;
if(!empty($insertionRows)) {
foreach($insertionRows as $insertionRow) {
$errorRows = $this->db->query("
SELECT * FROM `" . DB_PREFIX . "amazonus_product_error`
WHERE `sku` = '" . $this->db->escape($insertionRow['sku']) . "' AND `insertion_id` = '" . $this->db->escape($insertionRow['insertion_id']) . "'")->rows;
foreach($errorRows as $errorRow) {
$result[] = $errorRow;
}
}
}
return $result;