...
|
...
|
@@ -110,18 +110,20 @@ class HotrankModel |
|
|
'gender' => $data['gender'],
|
|
|
'road' => $data['road']);
|
|
|
$list = self::getSearchData($config, $page, 1);
|
|
|
$lister = $list['hotWeek']['list'];
|
|
|
$lister = array_values($lister);
|
|
|
if ($sid == 1 && $page == 1) {
|
|
|
$lister = array_slice($lister, 10, 50);
|
|
|
}
|
|
|
else {
|
|
|
$lister = array_slice($lister, 0, 50);
|
|
|
if (!empty($list)) {
|
|
|
$lister = $list['hotWeek']['list'];
|
|
|
$lister = array_values($lister);
|
|
|
if ($sid == 1 && $page == 1) {
|
|
|
$lister = array_slice($lister, 10, 50);
|
|
|
}
|
|
|
else {
|
|
|
$lister = array_slice($lister, 0, 50);
|
|
|
}
|
|
|
$data = array(
|
|
|
'code' => 200,
|
|
|
'data' => $lister,);
|
|
|
return $data;
|
|
|
}
|
|
|
$data = array(
|
|
|
'code' => 200,
|
|
|
'data' => $lister,);
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -171,6 +173,7 @@ class HotrankModel |
|
|
}
|
|
|
//根据给定查询数据搜索数据列表
|
|
|
$result = SearchData::searchElasticByCondition($param);
|
|
|
//人气单品,一周热卖数据处理
|
|
|
$data = self::getProductList($result, $page, $ajax);
|
|
|
return $data;
|
|
|
}
|
...
|
...
|
@@ -208,13 +211,13 @@ class HotrankModel |
|
|
return $product;
|
|
|
}
|
|
|
$data = $result['data']['product_list'];
|
|
|
$popular = array();
|
|
|
$hotWeek = array();
|
|
|
$popular = array(); //一周热卖
|
|
|
$hotWeek = array(); //人气单品
|
|
|
foreach ($data as $key => $val) {
|
|
|
if (empty($val['goods_list'])) {
|
|
|
continue;
|
|
|
}
|
|
|
//$defaultGoodsId = 0;
|
|
|
$defaultGoodsId = 0;
|
|
|
foreach ($val['goods_list'] as $v) {
|
|
|
if ($v['is_default'] == 'Y') {
|
|
|
$defaultGoodsId = empty($v['goods_id']) ? $val['goods_list'][0]['goods_id'] : $v['goods_id'];
|
...
|
...
|
@@ -226,8 +229,8 @@ class HotrankModel |
|
|
$product['rank'] = $key + 1;
|
|
|
$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'];
|
|
|
$product['price'] = (int) $val['market_price'] == (int) $val['sales_price'] ? false : $val['market_price'];
|
|
|
$product['sPrice'] = empty($val['sales_price']) ? false : $val['sales_price'];
|
|
|
if ($key <= 5) {
|
|
|
//6张大图
|
|
|
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
|
...
|
...
|
@@ -243,8 +246,8 @@ class HotrankModel |
|
|
//一周热卖
|
|
|
$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['marketPrice'] = (int) $val['market_price'] == (int) $val['sales_price'] ? false : $val['market_price'];
|
|
|
$product['salePrice'] = empty($val['sales_price']) ? false : $val['sales_price'];
|
|
|
$product['rank'] = '';
|
|
|
$product['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
|
|
|
$hot[] = $product;
|
...
|
...
|
|