Authored by cailing

热销排行数据格式修改

@@ -867,7 +867,6 @@ class Process @@ -867,7 +867,6 @@ class Process
867 $cacheKey = sprintf("%s_%s", CacheConfig::KEY_INDEX_BRANDS_LIST_DATA, $type_key); 867 $cacheKey = sprintf("%s_%s", CacheConfig::KEY_INDEX_BRANDS_LIST_DATA, $type_key);
868 Cache::set($cacheKey, $floor, 7200); 868 Cache::set($cacheKey, $floor, 7200);
869 $result['hotBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key; 869 $result['hotBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
870 - //print_r($result['hotBrands']['brandUrl']);  
871 } 870 }
872 return $result; 871 return $result;
873 } 872 }
@@ -3,8 +3,6 @@ namespace product; @@ -3,8 +3,6 @@ namespace product;
3 3
4 use Plugin\Images; 4 use Plugin\Images;
5 use Api\Yohobuy; 5 use Api\Yohobuy;
6 -//use Plugin\Helpers;  
7 -//use LibModels\Web\Home\IndexData;  
8 use \LibModels\Web\Product\HotrankData; 6 use \LibModels\Web\Product\HotrankData;
9 use \LibModels\Web\Product\SearchData; 7 use \LibModels\Web\Product\SearchData;
10 8
@@ -15,16 +13,18 @@ class HotrankModel { @@ -15,16 +13,18 @@ class HotrankModel {
15 */ 13 */
16 static public function getSearchData($param,$page,$ajax) 14 static public function getSearchData($param,$page,$ajax)
17 { 15 {
18 - // 调用接口查询商品数据 16 + // 调用接口查询商品数据
19 $result = SearchData::searchElasticByCondition($param); 17 $result = SearchData::searchElasticByCondition($param);
20 - //print_r($result);  
21 18
22 - if(!empty($result)){ 19 + if(!empty($result))
  20 + {
23 $res = self::getProductList($result,$page,$ajax); 21 $res = self::getProductList($result,$page,$ajax);
24 - if(!empty($res['popular'])){ 22 + if(!empty($res['popular']))
  23 + {
25 $data['popular'] = $res['popular']; 24 $data['popular'] = $res['popular'];
26 } 25 }
27 - if(!empty($res['hotWeek'])){ 26 + if(!empty($res['hotWeek']))
  27 + {
28 $data['hotWeek'] = $res['hotWeek']; 28 $data['hotWeek'] = $res['hotWeek'];
29 } 29 }
30 } 30 }
@@ -40,8 +40,10 @@ class HotrankModel { @@ -40,8 +40,10 @@ class HotrankModel {
40 { 40 {
41 $list = \LibModels\Web\Product\HotrankData::getHotranktag($client_type,$channel,$is_concurrent); 41 $list = \LibModels\Web\Product\HotrankData::getHotranktag($client_type,$channel,$is_concurrent);
42 $nav = array(); 42 $nav = array();
43 - if(!empty($list['data']['list'])){  
44 - foreach($list['data']['list'] as $li=>$lt){ 43 + if(!empty($list['data']['list']))
  44 + {
  45 + foreach($list['data']['list'] as $li=>$lt)
  46 + {
45 $nav[$li]['sid'] = $lt['id']; 47 $nav[$li]['sid'] = $lt['id'];
46 $nav[$li]['textCn'] = $lt['tag_name']; 48 $nav[$li]['textCn'] = $lt['tag_name'];
47 } 49 }
@@ -57,57 +59,58 @@ class HotrankModel { @@ -57,57 +59,58 @@ class HotrankModel {
57 { 59 {
58 // 调用发起请求 60 // 调用发起请求
59 Yohobuy::yarConcurrentLoop(); 61 Yohobuy::yarConcurrentLoop();
60 - /*----product start---------*/  
61 - if(empty($result) || empty($result['data']) || empty($result['data']['product_list'])){  
62 - return; 62 +
  63 + if(empty($result) || empty($result['data']) || empty($result['data']['product_list']))
  64 + {
  65 + return;
63 } 66 }
64 $data = $result['data']['product_list']; 67 $data = $result['data']['product_list'];
65 -  
66 $popular = array(); 68 $popular = array();
67 $hotWeek = array(); 69 $hotWeek = array();
68 - foreach($data as $key=>$val){  
69 - if(empty($val['goods_list'])){ 70 + foreach($data as $key=>$val)
  71 + {
  72 + if(empty($val['goods_list']))
  73 + {
70 continue; 74 continue;
71 } 75 }
72 $defaultGoodsId = 0; 76 $defaultGoodsId = 0;
73 - foreach ($val['goods_list'] as $v){  
74 - if($v['is_default'] == 'Y'){ 77 + foreach ($val['goods_list'] as $v)
  78 + {
  79 + if($v['is_default'] == 'Y')
  80 + {
75 $defaultGoodsId = $v['goods_id']; 81 $defaultGoodsId = $v['goods_id'];
76 } 82 }
77 } 83 }
78 - if(empty($defaultGoodsId)){ 84 + if(empty($defaultGoodsId))
  85 + {
79 $defaultGoodsId = $val['goods_list'][0]['goods_id']; 86 $defaultGoodsId = $val['goods_list'][0]['goods_id'];
80 } 87 }
81 88
82 $product_id = empty($val['product_id']) ? '' : $val['product_id']; 89 $product_id = empty($val['product_id']) ? '' : $val['product_id'];
83 - $re['url'] = 'http://item.yohobuy.com/product/pro_'.$product_id.'_'.$defaultGoodsId.'.html';  
84 -  
85 $re['name'] = $val['product_name']; 90 $re['name'] = $val['product_name'];
86 - if($key <= 9 && $page == 1 && $ajax == 0){  
87 - $re['rank'] = $key + 1;  
88 - if($key <= 5){  
89 - $re['price'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];  
90 - $re['sPrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];  
91 - $re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);  
92 - $popular['list'][] = $re;  
93 - }else{  
94 - $re['price'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];  
95 - $re['sPrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];  
96 - $re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);  
97 - $popular['list'][] = $re;  
98 - }  
99 - }else if ($ajax == 1){  
100 - $re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];  
101 - $re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];  
102 - $re['rank'] = ''; 91 + if($key <= 9 && $page == 1 && $ajax == 0)
  92 + {
  93 + //人气单品
  94 + $re['rank'] = $key + 1;
  95 + $re['href'] = 'http://item.yohobuy.com/product/pro_'.$product_id.'_'.$defaultGoodsId.'.html';
  96 + $re['price'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : $val['market_price'];
  97 + $re['sPrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
  98 + if($key <= 5)
  99 + {
  100 + $re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
  101 + $popular['list'][] = $re;
  102 + }else{
103 $re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2); 103 $re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
104 - $hot[] = $re;  
105 - }else{  
106 - $re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];  
107 - $re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];  
108 - $re['rank'] = '';  
109 - $re['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);  
110 - $hot[] = $re; 104 + $popular['list'][] = $re;
  105 + }
  106 + }else{
  107 + //一周热卖
  108 + $re['url'] = 'http://item.yohobuy.com/product/pro_'.$product_id.'_'.$defaultGoodsId.'.html';
  109 + $re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : $val['market_price'];
  110 + $re['salePrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
  111 + $re['rank'] = '';
  112 + $re['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
  113 + $hot[] = $re;
111 } 114 }
112 } 115 }
113 $popular['name'] = '人气单品'; 116 $popular['name'] = '人气单品';
@@ -56,241 +56,36 @@ class IndexController extends WebAction @@ -56,241 +56,36 @@ class IndexController extends WebAction
56 $this->_view->display('list',$data); 56 $this->_view->display('list',$data);
57 } 57 }
58 58
59 - public function hotrankAction() {  
60 -  
61 - $data = array(  
62 - 'hotrankPage' => true,  
63 - 'hotrank' => array(  
64 - array(  
65 - 'slide' => array(  
66 - 'list' => array(  
67 - array(  
68 - 'href' => '/?gender=1,3',  
69 - 'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'  
70 - ),  
71 - array(  
72 - 'href' => '/?gender=1,3',  
73 - 'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'  
74 - ),  
75 - array(  
76 - 'href' => '/?gender=1,3',  
77 - 'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'  
78 - ),  
79 - array(  
80 - 'href' => '/?gender=1,3',  
81 - 'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'  
82 - ),  
83 - array(  
84 - 'href' => '/?gender=1,3',  
85 - 'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'  
86 - ),  
87 - array(  
88 - 'href' => '/?gender=1,3',  
89 - 'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'  
90 - ),  
91 - array(  
92 - 'href' => '/?gender=1,3',  
93 - 'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'  
94 - ),  
95 - array(  
96 - 'href' => '/?gender=1,3',  
97 - 'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'  
98 - )  
99 - )  
100 - )  
101 - ),  
102 - array(  
103 - 'popular' => array(  
104 - 'name' => '人气单品',  
105 - 'list' => array(  
106 - array(  
107 - 'href' => '',  
108 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
109 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
110 - 'price' => '399',  
111 - 'sPrice' => '199',  
112 - 'rank' => '1'  
113 - ),  
114 - array(  
115 - 'href' => '',  
116 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
117 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
118 - 'price' => '399',  
119 - 'sPrice' => '199',  
120 - 'rank' => '2'  
121 - ),  
122 - array(  
123 - 'href' => '',  
124 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
125 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
126 - 'price' => '399',  
127 - 'sPrice' => '199',  
128 - 'rank' => '3'  
129 - ),  
130 - array(  
131 - 'href' => '',  
132 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
133 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
134 - 'price' => '399',  
135 - 'sPrice' => '199',  
136 - 'rank' => '4'  
137 - ),  
138 - array(  
139 - 'href' => '',  
140 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
141 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
142 - 'price' => '399',  
143 - 'sPrice' => '199',  
144 - 'rank' => '5'  
145 - ),  
146 - array(  
147 - 'href' => '',  
148 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
149 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
150 - 'price' => '399',  
151 - 'sPrice' => '199',  
152 - 'rank' => '6'  
153 - ),  
154 - array(  
155 - 'href' => '',  
156 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
157 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
158 - 'price' => '399',  
159 - 'sPrice' => '199',  
160 - 'rank' => '7'  
161 - ),  
162 - array(  
163 - 'href' => '',  
164 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
165 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
166 - 'price' => '399',  
167 - 'sPrice' => '199',  
168 - 'rank' => '8'  
169 - ),  
170 - array(  
171 - 'href' => '',  
172 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
173 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
174 - 'price' => '399',  
175 - 'sPrice' => '199',  
176 - 'rank' => '9'  
177 - ),  
178 - array(  
179 - 'href' => '',  
180 - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',  
181 - 'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',  
182 - 'price' => '399',  
183 - 'sPrice' => '199',  
184 - 'rank' => '10'  
185 - )  
186 - )  
187 -  
188 - )  
189 - ),  
190 - array(  
191 - 'hotBrands' => array(  
192 - 'name' => '热门品牌',  
193 - )  
194 - ),  
195 - array(  
196 - 'hotWeek' => array(  
197 - 'name' => '一周热卖',  
198 - 'nav' => array(  
199 - array(  
200 - 'textCn' => 'TOP100',  
201 - 'url' => '',  
202 - 'sid' => 1  
203 - ),  
204 - array(  
205 - 'textCn' => '上装',  
206 - 'url' => '',  
207 - 'sid' => 2  
208 - ),  
209 - array(  
210 - 'textCn' => '男生测试',  
211 - 'url' => '',  
212 - 'sid' => 3  
213 - ),  
214 - array(  
215 - 'textCn' => '配饰',  
216 - 'url' => '',  
217 - 'sid' => 4  
218 - )  
219 - ),  
220 - 'list' => array(  
221 - array(  
222 - 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',  
223 - 'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',  
224 - 'name' => 'MARtube马克图布 暖手宝移动电源萌兔',  
225 - 'marketPrice' => '109',  
226 - 'salePrice' => '129'  
227 - ),  
228 - array(  
229 - 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',  
230 - 'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',  
231 - 'name' => 'MARtube马克图布 暖手宝移动电源萌兔',  
232 - 'marketPrice' => '109',  
233 - 'salePrice' => '129'  
234 - ),  
235 - array(  
236 - 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',  
237 - 'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',  
238 - 'name' => 'MARtube马克图布 暖手宝移动电源萌兔',  
239 - 'marketPrice' => '109',  
240 - 'salePrice' => '129'  
241 - ),  
242 - array(  
243 - 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',  
244 - 'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',  
245 - 'name' => 'MARtube马克图布 暖手宝移动电源萌兔',  
246 - 'marketPrice' => '109',  
247 - 'salePrice' => '129'  
248 - ),  
249 - array(  
250 - 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',  
251 - 'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',  
252 - 'name' => 'MARtube马克图布 暖手宝移动电源萌兔',  
253 - 'marketPrice' => '109',  
254 - 'salePrice' => '129'  
255 - ),  
256 - array(  
257 - 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',  
258 - 'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',  
259 - 'name' => 'MARtube马克图布 暖手宝移动电源萌兔',  
260 - 'marketPrice' => '109',  
261 - 'salePrice' => '129'  
262 - ),  
263 - )  
264 - )  
265 - )  
266 - )  
267 - );  
268 -  
269 - 59 + /**
  60 + * 热销排行
  61 + */
  62 + public function hotrankAction()
  63 + {
  64 + //获取频道
270 $cookie = $this->getCookie('_Channel'); 65 $cookie = $this->getCookie('_Channel');
271 - $cookie = 'lifestyle';  
272 $this->channel = isset($cookie) ? $cookie : 'boys'; 66 $this->channel = isset($cookie) ? $cookie : 'boys';
273 - switch ($this->channel){  
274 - case 'boys' :  
275 - $this->gender = '1,3';  
276 - $this->road = 1;  
277 - $this->code = '80d772d8dff25300a2a2e4c97165330c';  
278 - break;  
279 - case 'girls' :  
280 - $this->gender = '2,3';  
281 - $this->road = 2;  
282 - $this->code = '8df64e505e94edb9881fd1e7efb702e9';  
283 - break;  
284 - case 'lifestyle' :  
285 - $this->gender = '';  
286 - $this->road = 4;  
287 - $this->code = 'd131aba83a84a6977eee3a7403a713de';  
288 - break;  
289 - case 'kids' :  
290 - $this->gender = '';  
291 - $this->road = 3;  
292 - $this->code = 'bd6a06a08f8ca9b0db762f78e0bc5b68';  
293 - break; 67 + switch ($this->channel)
  68 + {
  69 + case 'boys' :
  70 + $this->gender = '1,3';
  71 + $this->road = 1;
  72 + $this->code = '80d772d8dff25300a2a2e4c97165330c';
  73 + break;
  74 + case 'girls' :
  75 + $this->gender = '2,3';
  76 + $this->road = 2;
  77 + $this->code = '8df64e505e94edb9881fd1e7efb702e9';
  78 + break;
  79 + case 'lifestyle' :
  80 + $this->gender = '';
  81 + $this->road = 4;
  82 + $this->code = 'd131aba83a84a6977eee3a7403a713de';
  83 + break;
  84 + case 'kids' :
  85 + $this->gender = '';
  86 + $this->road = 3;
  87 + $this->code = 'bd6a06a08f8ca9b0db762f78e0bc5b68';
  88 + break;
294 89
295 } 90 }
296 $this->setWebNavHeader(\Index\HomeModel::$this->channel); 91 $this->setWebNavHeader(\Index\HomeModel::$this->channel);
@@ -298,6 +93,7 @@ class IndexController extends WebAction @@ -298,6 +93,7 @@ class IndexController extends WebAction
298 'footerTop'=> true, 93 'footerTop'=> true,
299 'hotrank' => array() 94 'hotrank' => array()
300 ); 95 );
  96 +
301 //焦点图 热门品牌 97 //焦点图 热门品牌
302 $focus = \Index\HomeModel::getChannelResource($this->channel, $this->code); 98 $focus = \Index\HomeModel::getChannelResource($this->channel, $this->code);
303 $data['hotrank']['slide'] = $focus[0]['slide']; 99 $data['hotrank']['slide'] = $focus[0]['slide'];
@@ -308,13 +104,15 @@ class IndexController extends WebAction @@ -308,13 +104,15 @@ class IndexController extends WebAction
308 $sort_id = $this->get('sid',0); 104 $sort_id = $this->get('sid',0);
309 $viewNum = 60; 105 $viewNum = 60;
310 $param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'stocknumber'=>1,'status'=>1,'gender'=>$this->gender,'attribute_not'=>2); 106 $param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'stocknumber'=>1,'status'=>1,'gender'=>$this->gender,'attribute_not'=>2);
311 - if($sort_id != 0){  
312 - $param['sort'] = $sort_id; 107 + if($sort_id != 0)
  108 + {
  109 + $param['sort'] = $sort_id;
313 } 110 }
314 - if($this->road == 3){  
315 - $param['msort'] = 365; 111 + if($this->road == 3)
  112 + {
  113 + $param['msort'] = 365;
316 }elseif($this->road == 4){ 114 }elseif($this->road == 4){
317 - $param['msort'] = 10; 115 + $param['msort'] = 10;
318 }else{ 116 }else{
319 $param['not_maxSortId'] = '10,365'; 117 $param['not_maxSortId'] = '10,365';
320 } 118 }
@@ -352,10 +150,9 @@ class IndexController extends WebAction @@ -352,10 +150,9 @@ class IndexController extends WebAction
352 $sort = $info['data']['category_id']; 150 $sort = $info['data']['category_id'];
353 } 151 }
354 } 152 }
355 - $viewNum = 60;  
356 - //过滤掉赠品  
357 - $param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'sort'=>$sort,'stocknumber'=>1,'status'=>1,'gender'=>$this->gender,  
358 - 'attribute_not'=>2); 153 + $viewNum = 60;
  154 + $param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'sort'=>$sort,'stocknumber'=>1,'status'=>1,
  155 + 'gender'=>$this->gender,'attribute_not'=>2);
359 if(empty($param['sort'])) 156 if(empty($param['sort']))
360 { 157 {
361 if($this->road == 3) 158 if($this->road == 3)
@@ -367,7 +164,7 @@ class IndexController extends WebAction @@ -367,7 +164,7 @@ class IndexController extends WebAction
367 $param['not_maxSortId'] = '10,365'; 164 $param['not_maxSortId'] = '10,365';
368 } 165 }
369 } 166 }
370 - 167 + //一周热卖
371 $list = \product\HotrankModel::getSearchData($param, $page, 1); 168 $list = \product\HotrankModel::getSearchData($param, $page, 1);
372 $lister = $list['hotWeek']['list']; 169 $lister = $list['hotWeek']['list'];
373 $lister = array_values($lister); 170 $lister = array_values($lister);
@@ -377,12 +174,8 @@ class IndexController extends WebAction @@ -377,12 +174,8 @@ class IndexController extends WebAction
377 }else{ 174 }else{
378 $lister = array_slice($lister, 0, 50); 175 $lister = array_slice($lister, 0, 50);
379 } 176 }
380 - $data = array(  
381 - 'code'=>200,  
382 - 'data'=>$lister,  
383 - ); 177 + $data = array( 'code'=>200, 'data'=>$lister,);
384 echo json_encode($data); 178 echo json_encode($data);
385 exit; 179 exit;
386 } 180 }
387 -}  
388 -?>  
  181 +}