OpenCart 🇺🇦

Метод ModelCatalogReview::getReviewsByProductId(...)

Схема

public mixed getReviewsByProductId ( $product_id, $start = 0, $limit = 20 )

Аргументы

Аргумент Возможный тип Описание
$product_id
$start = 0
$limit = 20

Описание

Метод пока еще не документирован.

Исходный код

if ($start < 0) {
	$start = 0;
}

if ($limit < 1) {
	$limit = 20;
}		

$query = $this->db->query("SELECT r.review_id, r.author, r.rating, r.text, p.product_id, pd.name, p.price, p.image, r.date_added FROM " . DB_PREFIX . "review r LEFT JOIN " . DB_PREFIX . "product p ON (r.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND p.date_available <= NOW() AND p.status = '1' AND r.status = '1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY r.date_added DESC LIMIT " . (int)$start . "," . (int)$limit);
	
return $query->rows;