...
|
...
|
@@ -67,9 +67,9 @@ class HotrankModel |
|
|
public static function getHotrankResource($data, $sid, $page)
|
|
|
{
|
|
|
//焦点图 热门品牌
|
|
|
// $focus = self::getFocusResource($data['channel'], $data['code']);
|
|
|
// $data['slide'] = $focus[0]['slide'];
|
|
|
// $data['hotBrands'] = $focus[1]['hotBrands'];
|
|
|
$focus = self::getFocusResource($data['channel'], $data['code']);
|
|
|
$data['slide'] = $focus[0]['slide'];
|
|
|
$data['hotBrands'] = $focus[1]['hotBrands'];
|
|
|
//人气单品 一周热卖
|
|
|
$sort = ($sid == 1) ? '' : $sid;
|
|
|
$config = array(
|
...
|
...
|
@@ -203,6 +203,7 @@ class HotrankModel |
|
|
public static function getProductList($result, $page, $ajax = 0)
|
|
|
{
|
|
|
$product = array();
|
|
|
$url = Helpers::url('/product/pro', '', 'item');
|
|
|
if (empty($result) || empty($result['data']) || empty($result['data']['product_list'])) {
|
|
|
return $product;
|
|
|
}
|
...
|
...
|
@@ -213,36 +214,35 @@ class HotrankModel |
|
|
if (empty($val['goods_list'])) {
|
|
|
continue;
|
|
|
}
|
|
|
$defaultGoodsId = 0;
|
|
|
//$defaultGoodsId = 0;
|
|
|
foreach ($val['goods_list'] as $v) {
|
|
|
if ($v['is_default'] == 'Y') {
|
|
|
$defaultGoodsId = $v['goods_id'];
|
|
|
$defaultGoodsId = empty($v['goods_id']) ? $val['goods_list'][0]['goods_id'] : $v['goods_id'];
|
|
|
}
|
|
|
}
|
|
|
if (empty($defaultGoodsId)) {
|
|
|
$defaultGoodsId = $val['goods_list'][0]['goods_id'];
|
|
|
}
|
|
|
$product_id = empty($val['product_id']) ? '' : $val['product_id'];
|
|
|
$product['name'] = $val['product_name'];
|
|
|
if ($key <= 9 && $page == 1 && $ajax == 0) {
|
|
|
//人气单品
|
|
|
$product['rank'] = $key + 1;
|
|
|
$product['href'] = 'http://item.yohobuy.com/product/pro_' . $product_id . '_' . $defaultGoodsId . '.html';
|
|
|
$product['title'] = $val['product_name'];
|
|
|
$product['href'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
|
|
|
$product['price'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price'];
|
|
|
$product['sPrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
|
|
|
if ($key <= 5) {
|
|
|
//6张大图
|
|
|
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
|
|
|
$popular['list'][] = $product;
|
|
|
}
|
|
|
else {
|
|
|
//4张小图
|
|
|
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
|
|
|
$popular['list'][] = $product;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
//一周热卖
|
|
|
// $product['url'] = 'http://item.yohobuy.com/product/pro_' . $product_id . '_' . $defaultGoodsId . '.html';
|
|
|
$product['url'] = Helpers::url('/product/pro',array('product_id' => $product_id,'defaultGoodsId'=> $defaultGoodsId),'item');
|
|
|
$product['name'] = $val['product_name'];
|
|
|
$product['url'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
|
|
|
$product['marketPrice'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price'];
|
|
|
$product['salePrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
|
|
|
$product['rank'] = '';
|
...
|
...
|
|