Authored by yangyang

统计前三个商品skn

... ... @@ -118,7 +118,8 @@ class SearchData
// return 'http://101.200.31.165/yohosearch/brand/list.json';
// return 'http://182.92.99.119:8080/yohosearch/brand/list.json';
}
return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search.json';
// return 'http://101.200.31.165/yohosearch/search.json';
//return 'http://101.200.31.165/yohosearch/search.json';
// return 'http://182.92.99.119:8080/yohosearch/search.json';
}
... ...
... ... @@ -59,11 +59,22 @@ class IndexController extends WebAction
//调用模型获得品牌页数据
$data = BrandsModel::getBrandSearchData($condition, $options);
//统计前三个商品
$skn=array();
if (isset($data['goods']) && !empty($data['goods'])) {
$arr = array_slice($data['goods'],0,3);
foreach ($arr as $key=>$value) {
$skn[] = $value['skn'];
}
}
$seo = $data['seo'];
$data = array(
//初始化js
'brandPage' => true,
'list' => $data
'list' => $data,
'skn' => $skn
);
$this->setBrandSeo($seo);
$this->setWebNavHeader();
... ...
... ... @@ -28,10 +28,21 @@ class ListController extends WebAction
$this->setListSeo($list['seo']);
/// 设置头部数据
$this->setWebNavHeader();
//统计前三个商品
$skn=array();
if (isset($list['goods']) && !empty($list['goods'])) {
$arr = array_slice($list['goods'],0,3);
foreach ($arr as $key=>$value) {
$skn[] = $value['skn'];
}
}
// 渲染模板
$this->_view->display('list', array(
'productListPage' => true, // JS控制初始化
'list' => $list,
'skn' => $skn
));
}
... ... @@ -50,9 +61,20 @@ class ListController extends WebAction
);
$newData = NewModel::getNewSearchData($condition, $options);
//统计前三个商品
$skn=array();
if (isset($newData['goods']) && !empty($newData['goods'])) {
$arr = array_slice($newData['goods'],0,3);
foreach ($arr as $key=>$value) {
$skn[] = $value['skn'];
}
}
$data = array(
'productListPage' => true,
'newSale' => $newData
'newSale' => $newData,
'skn' => $skn
);
// 设置SEO信息
$this->setNewSeo($newData['seo']);
... ... @@ -77,10 +99,21 @@ class ListController extends WebAction
$condition['p_d'] = '0.01,0.99';
}
$list = SearchModel::getListData($condition, $option);
//统计前三个商品
$skn=array();
if (isset($list['goods']) && !empty($list['goods'])) {
$arr = array_slice($list['goods'],0,3);
foreach ($arr as $key=>$value) {
$skn[] = $value['skn'];
}
}
$data = array(
//初始化js
'brandPage' => true,
'list' => $list
'list' => $list,
'skn' => $skn
);
// 设置SEO信息
$this->setSaleSeo($list['seo']);
... ...
... ... @@ -52,10 +52,21 @@ class SaleController extends WebAction
);
$saleData = SaleModel::getSaleSearchData($condition, $options, $specialInfo);
//统计前三个商品
$skn=array();
if (isset($saleData['goods']) && !empty($saleData['goods'])) {
$arr = array_slice($saleData['goods'],0,3);
foreach ($arr as $key=>$value) {
$skn[] = $value['skn'];
}
}
$data = array(
//初始化js
'productListPage' => true,
'newSale' => $saleData
'newSale' => $saleData,
'skn' => $skn
);
$this->setTitle('潮流商品搜索 | YOHO!有货');
$this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
... ...