Showing
1 changed file
with
30 additions
and
6 deletions
@@ -17,19 +17,43 @@ class NewsaleData | @@ -17,19 +17,43 @@ class NewsaleData | ||
17 | { | 17 | { |
18 | 18 | ||
19 | /** | 19 | /** |
20 | - * 获取新品到着,折扣专区焦点图数据 | ||
21 | - * @param string $contentCode 内容位置码 | ||
22 | - * @return array 新品到着焦点图有关数据 | 20 | + * 模糊搜索提供的关键词 |
21 | + * @param string $keyword 关键词 | ||
22 | + * @return array 根据跟定关键词搜索到的结果,包括数据数目count和提供的关键词keyword | ||
23 | */ | 23 | */ |
24 | - public static function getNewsaleFocus($contentCode) | 24 | + public static function searchFuzzyDatas($keyword) |
25 | { | 25 | { |
26 | // 构建必传参数 | 26 | // 构建必传参数 |
27 | $param = Yohobuy::param(); | 27 | $param = Yohobuy::param(); |
28 | 28 | ||
29 | - $param['content_code'] = $contentCode; | 29 | + $param['keyword'] = $keyword; |
30 | + $param['method'] = 'app.search.fuzzy'; | ||
30 | $param['client_secret'] = Sign::getSign($param); | 31 | $param['client_secret'] = Sign::getSign($param); |
31 | 32 | ||
32 | - return Yohobuy::get(Yohobuy::SERVICE_URL.'operations/api/v5/resource/get', $param); | 33 | + return Yohobuy::get(Yohobuy::API_URL, $param); |
34 | + } | ||
35 | + | ||
36 | + /** | ||
37 | + * 根据跟定查询数据搜索数据列表 | ||
38 | + * @param string $query 查询条件 | ||
39 | + * @param string $order 排列顺序,默认为倒序 | ||
40 | + * @param integer $page 指定查询是多少页,默认为第一页 | ||
41 | + * @param integer $limit 指定查询多少个,默认是60哥 | ||
42 | + * @return array 搜索到的数据 | ||
43 | + */ | ||
44 | + public static function searchLiDatas($query, $order = 's_t_desc', $page = 1, $limit = 60) | ||
45 | + { | ||
46 | + // 构建必传参数 | ||
47 | + $param = Yohobuy::param(); | ||
48 | + | ||
49 | + $param['query'] = $query; | ||
50 | + $param['method'] = 'app.search.li'; | ||
51 | + $param['order'] = $order; | ||
52 | + $param['page'] = $page; | ||
53 | + $param['limit'] = $limit; | ||
54 | + $param['client_secret'] = Sign::getSign($param); | ||
55 | + | ||
56 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
33 | } | 57 | } |
34 | 58 | ||
35 | } | 59 | } |
-
Please register or login to post a comment