...
|
...
|
@@ -3,7 +3,7 @@ use Action\WebAction; |
|
|
use LibModels\Web\Product\BrandData;
|
|
|
use LibModels\Web\Product\FavoriteData;
|
|
|
|
|
|
use \LibModels\Web\Product\HotrankData;
|
|
|
use LibModels\Web\Product\HotrankData;
|
|
|
use product\HotrankModel;
|
|
|
use LibModels\Web\Home\IndexData;
|
|
|
|
...
|
...
|
@@ -28,6 +28,8 @@ class IndexController extends WebAction |
|
|
$brandId = $brandInfo['data']['id'];
|
|
|
$node = isset($brandInfo['data']['static_content_code']) ? $brandInfo['data']['static_content_code'] : false;
|
|
|
$brandBanner = $brandInfo['data']['brand_banner'];
|
|
|
$brandNameEn = $brandInfo['data']['brand_name_en'];
|
|
|
$brandNameCn = $brandInfo['data']['brand_name_cn'];
|
|
|
} else {
|
|
|
$this->go(SITE_MAIN);
|
|
|
}
|
...
|
...
|
@@ -47,6 +49,8 @@ class IndexController extends WebAction |
|
|
$options['brandId'] = $brandId;
|
|
|
$options['node'] = $node;
|
|
|
$options['brandBanner'] = $brandBanner;
|
|
|
$options['brandNameEn'] = $brandNameEn;
|
|
|
$options['brandNameCn'] = $brandNameCn;
|
|
|
$options['reviewNum'] = 6;
|
|
|
|
|
|
//调用模型获得数据
|
...
|
...
|
@@ -140,28 +144,15 @@ class IndexController extends WebAction |
|
|
);
|
|
|
|
|
|
//焦点图 热门品牌
|
|
|
$focus = \Index\HomeModel::getChannelResource($channel['channel'], $channel['code']);
|
|
|
$data['hotrank']['slide'] = $focus[0]['slide'];
|
|
|
$data['hotrank']['hotBrands'] = $focus[1]['hotBrands'];
|
|
|
|
|
|
$focus = \product\HotrankModel::getFocusResource($channel['channel'], $channel['code']);
|
|
|
$data['hotrank']['slide'] = $focus[0]['slide'];
|
|
|
$data['hotrank']['hotBrands'] = $focus[1]['hotBrands'];
|
|
|
|
|
|
//人气单品 一周热卖
|
|
|
$page = $this->get('page',1);
|
|
|
$sort_id = $this->get('sid',0);
|
|
|
$viewNum = 60;
|
|
|
$param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'stocknumber'=>1,'status'=>1,'gender'=>$channel['gender'],'attribute_not'=>2);
|
|
|
if($sort_id != 0)
|
|
|
{
|
|
|
$param['sort'] = $sort_id;
|
|
|
}
|
|
|
if($channel['road'] == 3)
|
|
|
{
|
|
|
$param['msort'] = 365;
|
|
|
}elseif($channel['road'] == 4){
|
|
|
$param['msort'] = 10;
|
|
|
}else{
|
|
|
$param['not_maxSortId'] = '10,365';
|
|
|
}
|
|
|
$publiclist = \product\HotrankModel::getSearchData($param,$page,0);
|
|
|
$page = $this->get('page',1);
|
|
|
$sort_id = $this->get('sid',0);
|
|
|
$config = array('sort' =>$sort_id,'gender' => $channel['gender'],'road' => $channel['road']);
|
|
|
$publiclist = \product\HotrankModel::getSearchData($config,$page,0);
|
|
|
$data['hotrank']['popular'] = $publiclist['popular'];
|
|
|
$data['hotrank']['hotWeek'] = $publiclist['hotWeek'];
|
|
|
|
...
|
...
|
@@ -176,7 +167,6 @@ class IndexController extends WebAction |
|
|
*/
|
|
|
public function getdataAction()
|
|
|
{
|
|
|
|
|
|
$page = $this->get('page',1);
|
|
|
//加载到100个以后停止
|
|
|
if($page > 2)
|
...
|
...
|
@@ -196,24 +186,11 @@ class IndexController extends WebAction |
|
|
$sort = $info['data']['category_id'];
|
|
|
}
|
|
|
}
|
|
|
$viewNum = 60;
|
|
|
//获取频道资源
|
|
|
$channel = \product\HotrankModel::getChannelResource();
|
|
|
$param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'sort'=>$sort,'stocknumber'=>1,'status'=>1,
|
|
|
'gender'=>$channel['gender'],'attribute_not'=>2,);
|
|
|
if(empty($param['sort']))
|
|
|
{
|
|
|
if($channel['road'] == 3)
|
|
|
{
|
|
|
$param['msort'] = 365;
|
|
|
}elseif($channel['road'] == 4){
|
|
|
$param['msort'] = 10;
|
|
|
}else{
|
|
|
$param['not_maxSortId'] = '10,365';
|
|
|
}
|
|
|
}
|
|
|
//一周热卖
|
|
|
$list = \product\HotrankModel::getSearchData($param, $page, 1);
|
|
|
$config = array('sort' =>$sort,'gender' => $channel['gender'],'road' => $channel['road']);
|
|
|
$list = \product\HotrankModel::getSearchData($config, $page, 1);
|
|
|
$lister = $list['hotWeek']['list'];
|
|
|
$lister = array_values($lister);
|
|
|
if($sid == 1 && $page == 1)
|
...
|
...
|
|