Authored by 周少峰

切换接口,屏蔽notice

... ... @@ -34,16 +34,20 @@ class SearchData extends \LibModels\Wap\Product\SearchData
case 'developer':
default:
if ($type == 'sort') {
return 'http://101.200.31.165/yohosearch/sortgroup.json';
//return 'http://101.200.31.165/yohosearch/sortgroup.json';
return 'http://192.168.10.64:8080/yohosearch/sortgroup.json';
}
elseif ($type == 'discount') {
return 'http://101.200.31.165/yohosearch/discount.json';
//return 'http://101.200.31.165/yohosearch/discount.json';
return 'http://192.168.10.64:8080/yohosearch/discount.json';
}
elseif ($type == 'recent') {
return 'http://101.200.31.165/yohosearch/recent.json';
//return 'http://101.200.31.165/yohosearch/recent.json';
return 'http://192.168.10.64:8080/yohosearch/recent.json';
}
elseif ($type == 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
//return 'http://101.200.31.165/yohosearch/shops.json';
return 'http://192.168.10.64:8080/yohosearch/shops.json';
}
// return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search-once.json';
... ...
... ... @@ -59,19 +59,19 @@ class HelperSearch
self::$options = $options;
unset(self::$params['/']);
unset(self::$params['page']);
self::$filter = $data['product']['filter'];
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
//产品列表
$result['goods'] = self::getProductList($data['product']['product_list'], $options['imgSize']);
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
//总页数
$result['page_total'] = $data['product']['page_total'];
self::$pageTotal = $data['product']['page_total'];
$result['page_total'] = isset($data['product']['page_total']) ? $data['product']['page_total'] : '';
self::$pageTotal = $result['page_total'];
//当前页
$result['page'] = $data['product']['page'];
$result['page'] = isset($data['product']['page']) ? $data['product']['page'] : '';
self::$page = $result['page'];
//筛选条件
$result['filters'] = self::filter();
$result['filters'] = isset($data['product']['filter']) ? self::filter() : array();
//排序方式、显示数量等其他选项
$result['opts'] = self::getOpts();
$result['opts'] = isset($data['product']['filter']) ? self::getOpts() : array();
//下一页
$result['hasNextPage'] = self::next($data['product']['page_total']);
//全部折扣
... ... @@ -361,7 +361,6 @@ class HelperSearch
$brandIds = isset($params['brand']) && !empty($params['brand']) ? explode(',', $params['brand']) : array();
if (isset($filter['brand']) && !empty($filter['brand'])) {
$brand = $filter['brand'];
// print_r($filter); exit;
//已选中品牌数量
$existBrandNum = 0;
//已选中品牌标签名
... ... @@ -427,15 +426,20 @@ class HelperSearch
if ($key && !in_array($key, $index_key) && !is_numeric($key)) {
$index['index'] = strtolower(($key));
$index['name'] = $key;
$result['brandIndex'][] = $index;
$index_key[] = $index;
}
if ($key && !in_array($key, $index_key) && is_numeric($key) && count($result['brandIndex']) === 1) {
$index['index'] = '0-9';
$index['name'] = '0~9';
$result['brandIndex'][] = $index;
}
if (is_array($val)) {
foreach ($val as $v) {
$result['brandsShow'][] = $v;
}
}
}
$result['brandIndex'] = array_merge($result['brandIndex'], $index_key);
unset($brandList);
}
//搜索页已选中,返回空
... ...
... ... @@ -148,13 +148,8 @@ class SearchModel
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['sortCondition']);
// 组合搜索折扣区间url
$urlList['discount'] = HelperSearch::getDiscountUrl($searchCondition['condition']);
// 组合搜索最新上架url
//$urlList['recent'] = HelperSearch::getRecentShelveUrl($searchCondition['condition']);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result = Yohobuy::getMulti($urlList, array(), true);
// 组织模板数据
$data = HelperSearch::getList($result, $searchCondition['options']);
return $data;
... ... @@ -179,8 +174,6 @@ class SearchModel
$param['keyword'] = $searchCondition['condition']['query'];
$urlList['shop'] = HelperSearch::getShopUrl($param);
}
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result = Yohobuy::getMulti($urlList, array(), true);
// 组织模板数据
$data = HelperSearch::getList($result, $searchCondition['options']);
... ... @@ -229,7 +222,6 @@ class SearchModel
*/
public static function getSortSize($condition)
{
$size = array();
//返回搜索条件
$condition['needFilter'] = 1;
$condition['viewNum'] = 1;
... ...