本文整理匯總了PHP中ProductSale::getBestSalesManufacturer方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProductSale::getBestSalesManufacturer方法的具體用法?PHP ProductSale::getBestSalesManufacturer怎麽用?PHP ProductSale::getBestSalesManufacturer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ProductSale
的用法示例。
在下文中一共展示了ProductSale::getBestSalesManufacturer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTopSalesProducts
public function getTopSalesProducts()
{
//see if the html fragment is in memcache
$memcache = new Memcache();
if ($memcache->connect('127.0.0.1', 11211)) {
$topProducts = $memcache->get('brand-top-products-' . $this->manufacturer->id);
if ($topProducts) {
return $topProducts;
} else {
$topProducts = ProductSale::getBestSalesManufacturer((int) self::$cookie->id_lang, $this->manufacturer->id, 0, 15, null, null, false);
$memcache->set('brand-top-products-' . $this->manufacturer->id, $topProducts, false, 172800);
//cache for 2 days
return $topProducts;
}
} else {
return ProductSale::getBestSalesManufacturer((int) self::$cookie->id_lang, $this->manufacturer->id, 0, 15, null, null, false);
}
}