Authored by whb

修改搜索的

@@ -17,22 +17,43 @@ class SearchData extends \LibModels\Wap\Product\SearchData @@ -17,22 +17,43 @@ class SearchData extends \LibModels\Wap\Product\SearchData
17 defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer'); 17 defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
18 switch (APPLICATION_ENV) { 18 switch (APPLICATION_ENV) {
19 case 'release': 19 case 'release':
  20 + if ($type == 'sort') {
  21 + return 'http://101.201.178.220/yohosearch/sortgroup.json';
  22 + }
  23 + elseif ($type == 'discount') {
  24 + return 'http://101.201.178.220/yohosearch/discount.json';
  25 + }
  26 + elseif ($type == 'recent') {
  27 + return 'http://101.201.178.220/yohosearch/recent.json';
  28 + }
  29 + elseif ($type == 'suggest') {
  30 + return 'http://101.201.178.220/yohosearch/suggest.json';
  31 + }
  32 + else if($type == 'new-shelve') {
  33 + return 'http://101.201.178.220/yohosearch/new-shelve.json';
  34 + }
  35 + elseif ($type == 'shop') {
  36 + return 'http://101.201.178.220/yohosearch/shops.json';
  37 + }
  38 + return 'http://101.201.178.220/yohosearch/search.json';
20 case 'preview': 39 case 'preview':
21 if ($type == 'sort') { 40 if ($type == 'sort') {
22 - return 'http://100.98.132.63/yohosearch/sortgroup.json'; 41 + return 'http://101.200.31.165/yohosearch/sortgroup.json';
23 } 42 }
24 elseif ($type == 'discount') { 43 elseif ($type == 'discount') {
25 - return 'http://100.98.132.63/yohosearch/discount.json'; 44 + return 'http://101.200.31.165/yohosearch/discount.json';
26 } 45 }
27 elseif ($type == 'recent') { 46 elseif ($type == 'recent') {
28 - return 'http://100.98.132.63/yohosearch/recent.json'; 47 + return 'http://101.200.31.165/yohosearch/recent.json';
29 } 48 }
30 elseif ($type == 'suggest') { 49 elseif ($type == 'suggest') {
31 - //return 'http://101.200.31.165/yohosearch/suggest.json';  
32 - return 'http://100.98.132.63/yohosearch/suggest.json'; 50 + return 'http://101.200.31.165/yohosearch/suggest.json';
  51 + }
  52 + else if($type == 'new-shelve') {
  53 + return 'http://101.200.31.165/yohosearch/new-shelve.json';
33 } 54 }
34 elseif ($type == 'shop') { 55 elseif ($type == 'shop') {
35 - return 'http://100.98.132.63/yohosearch/shops.json'; 56 + return 'http://101.200.31.165/yohosearch/shops.json';
36 } 57 }
37 return 'http://101.200.31.165/yohosearch/search.json'; 58 return 'http://101.200.31.165/yohosearch/search.json';
38 case 'test': 59 case 'test':
@@ -54,6 +75,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData @@ -54,6 +75,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData
54 // return 'http://101.200.31.165/yohosearch/suggest.json'; 75 // return 'http://101.200.31.165/yohosearch/suggest.json';
55 return 'http://182.92.99.119:8080/yohosearch/suggest.json'; 76 return 'http://182.92.99.119:8080/yohosearch/suggest.json';
56 } 77 }
  78 + else if($type == 'new-shelve') {
  79 + return 'http://182.92.99.119:8080/yohosearch/new-shelve.json';
  80 + }
57 elseif ($type == 'shop') { 81 elseif ($type == 'shop') {
58 //return 'http://101.200.31.165/yohosearch/shops.json'; 82 //return 'http://101.200.31.165/yohosearch/shops.json';
59 return 'http://182.92.99.119:8080/yohosearch/shops.json'; 83 return 'http://182.92.99.119:8080/yohosearch/shops.json';
@@ -174,9 +198,14 @@ class SearchData extends \LibModels\Wap\Product\SearchData @@ -174,9 +198,14 @@ class SearchData extends \LibModels\Wap\Product\SearchData
174 foreach ($sortList as $key => $value) { 198 foreach ($sortList as $key => $value) {
175 $lastIndex = $value['viewNum'] - 1; 199 $lastIndex = $value['viewNum'] - 1;
176 // 业务逻辑:一个品类不满指定个数时,前台不显示 200 // 业务逻辑:一个品类不满指定个数时,前台不显示
177 - if (!empty($searchd[$key]) && isset($searchd[$key]['product_list'][$lastIndex])) { 201 + if (!empty($searchd[$key])) {
  202 + if(isset($searchd[$key]['product_list'][$lastIndex])) {//search
178 $data = array_merge($data, $searchd[$key]['product_list']); 203 $data = array_merge($data, $searchd[$key]['product_list']);
179 } 204 }
  205 + else if(isset($searchd[$key][$lastIndex])) {//new-shelve
  206 + $data = array_merge($data, $searchd[$key]);
  207 + }
  208 + }
180 } 209 }
181 // 用完清空不使用的变量 210 // 用完清空不使用的变量
182 $searchd = array(); 211 $searchd = array();
@@ -197,7 +226,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData @@ -197,7 +226,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData
197 $option = array(); 226 $option = array();
198 foreach ($sortList as $key => $value) { 227 foreach ($sortList as $key => $value) {
199 $option = $params + $value; 228 $option = $params + $value;
200 - $urlList[$key] = Yohobuy::httpBuildQuery(self::getUrl('search'), $option); 229 + $urlList[$key] = Yohobuy::httpBuildQuery(self::getUrl('new-shelve'), $option);
201 } 230 }
202 return $urlList; 231 return $urlList;
203 } 232 }