|
@@ -19,12 +19,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
|
@@ -19,12 +19,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
19
|
case 'release':
|
19
|
case 'release':
|
20
|
if($type == 'sort'){
|
20
|
if($type == 'sort'){
|
21
|
return 'http://100.98.132.63/yohosearch/sortgroup.json';
|
21
|
return 'http://100.98.132.63/yohosearch/sortgroup.json';
|
22
|
- }elseif($type == 'discount'){
|
|
|
23
|
- return 'http://100.98.132.63/yohosearch/discount.json';
|
|
|
24
|
- }elseif($type == 'recent'){
|
|
|
25
|
- return 'http://100.98.132.63/yohosearch/recent.json';
|
|
|
26
|
- }elseif($type == 'review'){
|
|
|
27
|
-
|
22
|
+ }
|
|
|
23
|
+ elseif($type == 'suggest'){
|
|
|
24
|
+ return 'http://100.98.132.63/yohosearch/suggest.json';
|
28
|
}
|
25
|
}
|
29
|
return 'http://100.98.132.63/yohosearch/search.json';
|
26
|
return 'http://100.98.132.63/yohosearch/search.json';
|
30
|
case 'test':
|
27
|
case 'test':
|
|
@@ -34,14 +31,10 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
|
@@ -34,14 +31,10 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
34
|
if($type == 'sort'){
|
31
|
if($type == 'sort'){
|
35
|
return 'http://101.200.31.165/yohosearch/sortgroup.json';
|
32
|
return 'http://101.200.31.165/yohosearch/sortgroup.json';
|
36
|
}
|
33
|
}
|
37
|
- elseif($type == 'discount'){
|
|
|
38
|
- return 'http://101.200.31.165/yohosearch/discount.json';
|
|
|
39
|
- }
|
|
|
40
|
- elseif($type == 'recent'){
|
|
|
41
|
- return 'http://101.200.31.165/yohosearch/recent.json';
|
|
|
42
|
- }elseif($type == 'review'){
|
|
|
43
|
- return 'http://itemapi.yohobuy.com/item/item/recentreview';
|
34
|
+ elseif($type == 'suggest'){
|
|
|
35
|
+ return 'http://101.200.31.165/yohosearch/suggest.json';
|
44
|
}
|
36
|
}
|
|
|
37
|
+
|
45
|
return 'http://101.200.31.165/yohosearch/search.json';
|
38
|
return 'http://101.200.31.165/yohosearch/search.json';
|
46
|
}
|
39
|
}
|
47
|
}
|
40
|
}
|
|
@@ -116,36 +109,19 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
|
@@ -116,36 +109,19 @@ class SearchData extends \LibModels\Wap\Product\SearchData |
116
|
}
|
109
|
}
|
117
|
|
110
|
|
118
|
/**
|
111
|
/**
|
119
|
- * 获取折扣区间
|
|
|
120
|
- */
|
|
|
121
|
- public static function getDiscount(){
|
|
|
122
|
- return Yohobuy::get(self::getUrl('discount'));
|
|
|
123
|
- }
|
|
|
124
|
-
|
|
|
125
|
- /**
|
|
|
126
|
- * 获取最新上架
|
|
|
127
|
- */
|
|
|
128
|
- public static function recentShelve(){
|
|
|
129
|
- return Yohobuy::get(self::getUrl('recent'));
|
|
|
130
|
- }
|
|
|
131
|
-
|
|
|
132
|
- /**
|
|
|
133
|
- * 搜索品牌店铺信息
|
|
|
134
|
- * @param array $params 参数
|
112
|
+ * 获取搜索提示
|
|
|
113
|
+ * @param $param
|
|
|
114
|
+ * @param $cache
|
135
|
* @return array
|
115
|
* @return array
|
136
|
*/
|
116
|
*/
|
137
|
- public static function getShop(array $params)
|
117
|
+ public static function getSuggest($param, $cache = false)
|
138
|
{
|
118
|
{
|
139
|
- return Yohobuy::get(self::$shopsUrl,$params);
|
119
|
+ if (empty($param['query'])) {
|
|
|
120
|
+ return array();
|
140
|
}
|
121
|
}
|
141
|
-
|
|
|
142
|
- /**
|
|
|
143
|
- * 获取最近浏览记录
|
|
|
144
|
- * @param int $limit
|
|
|
145
|
- * @return json
|
|
|
146
|
- */
|
|
|
147
|
- public static function getRecentReview($limit = 0)
|
|
|
148
|
- {
|
|
|
149
|
-
|
122
|
+ if (empty($param['size'])) {
|
|
|
123
|
+ $param['size'] = 10;
|
|
|
124
|
+ }
|
|
|
125
|
+ return Yohobuy::get(self::getUrl('suggest'),$param, $cache);
|
150
|
}
|
126
|
}
|
151
|
} |
127
|
} |