Authored by yangyang

统计前三个商品skn

@@ -118,7 +118,8 @@ class SearchData @@ -118,7 +118,8 @@ class SearchData
118 // return 'http://101.200.31.165/yohosearch/brand/list.json'; 118 // return 'http://101.200.31.165/yohosearch/brand/list.json';
119 // return 'http://182.92.99.119:8080/yohosearch/brand/list.json'; 119 // return 'http://182.92.99.119:8080/yohosearch/brand/list.json';
120 } 120 }
121 - return 'http://101.200.31.165/yohosearch/search.json'; 121 + return 'http://192.168.10.64:8080/yohosearch/search.json';
  122 +// return 'http://101.200.31.165/yohosearch/search.json';
122 //return 'http://101.200.31.165/yohosearch/search.json'; 123 //return 'http://101.200.31.165/yohosearch/search.json';
123 // return 'http://182.92.99.119:8080/yohosearch/search.json'; 124 // return 'http://182.92.99.119:8080/yohosearch/search.json';
124 } 125 }
@@ -58,12 +58,23 @@ class IndexController extends WebAction @@ -58,12 +58,23 @@ class IndexController extends WebAction
58 $options['action'] = 'brand';//说明当前方法名 58 $options['action'] = 'brand';//说明当前方法名
59 59
60 //调用模型获得品牌页数据 60 //调用模型获得品牌页数据
61 - $data = BrandsModel::getBrandSearchData($condition, $options); 61 + $data = BrandsModel::getBrandSearchData($condition, $options);
  62 +
  63 + //统计前三个商品
  64 + $skn=array();
  65 + if (isset($data['goods']) && !empty($data['goods'])) {
  66 + $arr = array_slice($data['goods'],0,3);
  67 + foreach ($arr as $key=>$value) {
  68 + $skn[] = $value['skn'];
  69 + }
  70 + }
  71 +
62 $seo = $data['seo']; 72 $seo = $data['seo'];
63 $data = array( 73 $data = array(
64 //初始化js 74 //初始化js
65 'brandPage' => true, 75 'brandPage' => true,
66 - 'list' => $data 76 + 'list' => $data,
  77 + 'skn' => $skn
67 ); 78 );
68 $this->setBrandSeo($seo); 79 $this->setBrandSeo($seo);
69 $this->setWebNavHeader(); 80 $this->setWebNavHeader();
@@ -28,10 +28,21 @@ class ListController extends WebAction @@ -28,10 +28,21 @@ class ListController extends WebAction
28 $this->setListSeo($list['seo']); 28 $this->setListSeo($list['seo']);
29 /// 设置头部数据 29 /// 设置头部数据
30 $this->setWebNavHeader(); 30 $this->setWebNavHeader();
  31 +
  32 + //统计前三个商品
  33 + $skn=array();
  34 + if (isset($list['goods']) && !empty($list['goods'])) {
  35 + $arr = array_slice($list['goods'],0,3);
  36 + foreach ($arr as $key=>$value) {
  37 + $skn[] = $value['skn'];
  38 + }
  39 + }
  40 +
31 // 渲染模板 41 // 渲染模板
32 $this->_view->display('list', array( 42 $this->_view->display('list', array(
33 'productListPage' => true, // JS控制初始化 43 'productListPage' => true, // JS控制初始化
34 'list' => $list, 44 'list' => $list,
  45 + 'skn' => $skn
35 )); 46 ));
36 } 47 }
37 48
@@ -50,9 +61,20 @@ class ListController extends WebAction @@ -50,9 +61,20 @@ class ListController extends WebAction
50 ); 61 );
51 62
52 $newData = NewModel::getNewSearchData($condition, $options); 63 $newData = NewModel::getNewSearchData($condition, $options);
  64 +
  65 + //统计前三个商品
  66 + $skn=array();
  67 + if (isset($newData['goods']) && !empty($newData['goods'])) {
  68 + $arr = array_slice($newData['goods'],0,3);
  69 + foreach ($arr as $key=>$value) {
  70 + $skn[] = $value['skn'];
  71 + }
  72 + }
  73 +
53 $data = array( 74 $data = array(
54 'productListPage' => true, 75 'productListPage' => true,
55 - 'newSale' => $newData 76 + 'newSale' => $newData,
  77 + 'skn' => $skn
56 ); 78 );
57 // 设置SEO信息 79 // 设置SEO信息
58 $this->setNewSeo($newData['seo']); 80 $this->setNewSeo($newData['seo']);
@@ -77,10 +99,21 @@ class ListController extends WebAction @@ -77,10 +99,21 @@ class ListController extends WebAction
77 $condition['p_d'] = '0.01,0.99'; 99 $condition['p_d'] = '0.01,0.99';
78 } 100 }
79 $list = SearchModel::getListData($condition, $option); 101 $list = SearchModel::getListData($condition, $option);
  102 +
  103 + //统计前三个商品
  104 + $skn=array();
  105 + if (isset($list['goods']) && !empty($list['goods'])) {
  106 + $arr = array_slice($list['goods'],0,3);
  107 + foreach ($arr as $key=>$value) {
  108 + $skn[] = $value['skn'];
  109 + }
  110 + }
  111 +
80 $data = array( 112 $data = array(
81 //初始化js 113 //初始化js
82 'brandPage' => true, 114 'brandPage' => true,
83 - 'list' => $list 115 + 'list' => $list,
  116 + 'skn' => $skn
84 ); 117 );
85 // 设置SEO信息 118 // 设置SEO信息
86 $this->setSaleSeo($list['seo']); 119 $this->setSaleSeo($list['seo']);
@@ -52,10 +52,21 @@ class SaleController extends WebAction @@ -52,10 +52,21 @@ class SaleController extends WebAction
52 ); 52 );
53 53
54 $saleData = SaleModel::getSaleSearchData($condition, $options, $specialInfo); 54 $saleData = SaleModel::getSaleSearchData($condition, $options, $specialInfo);
  55 +
  56 + //统计前三个商品
  57 + $skn=array();
  58 + if (isset($saleData['goods']) && !empty($saleData['goods'])) {
  59 + $arr = array_slice($saleData['goods'],0,3);
  60 + foreach ($arr as $key=>$value) {
  61 + $skn[] = $value['skn'];
  62 + }
  63 + }
  64 +
55 $data = array( 65 $data = array(
56 //初始化js 66 //初始化js
57 'productListPage' => true, 67 'productListPage' => true,
58 - 'newSale' => $saleData 68 + 'newSale' => $saleData,
  69 + 'skn' => $skn
59 ); 70 );
60 $this->setTitle('潮流商品搜索 | YOHO!有货'); 71 $this->setTitle('潮流商品搜索 | YOHO!有货');
61 $this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流'); 72 $this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');