...
|
...
|
@@ -17,22 +17,43 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
|
|
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
|
|
|
switch (APPLICATION_ENV) {
|
|
|
case 'release':
|
|
|
if ($type == 'sort') {
|
|
|
return 'http://101.201.178.220/yohosearch/sortgroup.json';
|
|
|
}
|
|
|
elseif ($type == 'discount') {
|
|
|
return 'http://101.201.178.220/yohosearch/discount.json';
|
|
|
}
|
|
|
elseif ($type == 'recent') {
|
|
|
return 'http://101.201.178.220/yohosearch/recent.json';
|
|
|
}
|
|
|
elseif ($type == 'suggest') {
|
|
|
return 'http://101.201.178.220/yohosearch/suggest.json';
|
|
|
}
|
|
|
else if($type == 'new-shelve') {
|
|
|
return 'http://101.201.178.220/yohosearch/new-shelve.json';
|
|
|
}
|
|
|
elseif ($type == 'shop') {
|
|
|
return 'http://101.201.178.220/yohosearch/shops.json';
|
|
|
}
|
|
|
return 'http://101.201.178.220/yohosearch/search.json';
|
|
|
case 'preview':
|
|
|
if ($type == 'sort') {
|
|
|
return 'http://100.98.132.63/yohosearch/sortgroup.json';
|
|
|
return 'http://101.200.31.165/yohosearch/sortgroup.json';
|
|
|
}
|
|
|
elseif ($type == 'discount') {
|
|
|
return 'http://100.98.132.63/yohosearch/discount.json';
|
|
|
return 'http://101.200.31.165/yohosearch/discount.json';
|
|
|
}
|
|
|
elseif ($type == 'recent') {
|
|
|
return 'http://100.98.132.63/yohosearch/recent.json';
|
|
|
return 'http://101.200.31.165/yohosearch/recent.json';
|
|
|
}
|
|
|
elseif ($type == 'suggest') {
|
|
|
//return 'http://101.200.31.165/yohosearch/suggest.json';
|
|
|
return 'http://100.98.132.63/yohosearch/suggest.json';
|
|
|
return 'http://101.200.31.165/yohosearch/suggest.json';
|
|
|
}
|
|
|
else if($type == 'new-shelve') {
|
|
|
return 'http://101.200.31.165/yohosearch/new-shelve.json';
|
|
|
}
|
|
|
elseif ($type == 'shop') {
|
|
|
return 'http://100.98.132.63/yohosearch/shops.json';
|
|
|
return 'http://101.200.31.165/yohosearch/shops.json';
|
|
|
}
|
|
|
return 'http://101.200.31.165/yohosearch/search.json';
|
|
|
case 'test':
|
...
|
...
|
@@ -54,6 +75,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
|
|
// return 'http://101.200.31.165/yohosearch/suggest.json';
|
|
|
return 'http://182.92.99.119:8080/yohosearch/suggest.json';
|
|
|
}
|
|
|
else if($type == 'new-shelve') {
|
|
|
return 'http://182.92.99.119:8080/yohosearch/new-shelve.json';
|
|
|
}
|
|
|
elseif ($type == 'shop') {
|
|
|
//return 'http://101.200.31.165/yohosearch/shops.json';
|
|
|
return 'http://182.92.99.119:8080/yohosearch/shops.json';
|
...
|
...
|
@@ -174,8 +198,13 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
|
|
foreach ($sortList as $key => $value) {
|
|
|
$lastIndex = $value['viewNum'] - 1;
|
|
|
// 业务逻辑:一个品类不满指定个数时,前台不显示
|
|
|
if (!empty($searchd[$key]) && isset($searchd[$key]['product_list'][$lastIndex])) {
|
|
|
$data = array_merge($data, $searchd[$key]['product_list']);
|
|
|
if (!empty($searchd[$key])) {
|
|
|
if(isset($searchd[$key]['product_list'][$lastIndex])) {//search
|
|
|
$data = array_merge($data, $searchd[$key]['product_list']);
|
|
|
}
|
|
|
else if(isset($searchd[$key][$lastIndex])) {//new-shelve
|
|
|
$data = array_merge($data, $searchd[$key]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// 用完清空不使用的变量
|
...
|
...
|
@@ -197,7 +226,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
|
|
$option = array();
|
|
|
foreach ($sortList as $key => $value) {
|
|
|
$option = $params + $value;
|
|
|
$urlList[$key] = Yohobuy::httpBuildQuery(self::getUrl('search'), $option);
|
|
|
$urlList[$key] = Yohobuy::httpBuildQuery(self::getUrl('new-shelve'), $option);
|
|
|
}
|
|
|
return $urlList;
|
|
|
}
|
...
|
...
|
|