ListData.php
1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace LibModels\Wap\Guang;
use Api\Sign;
use Api\Yohobuy;
/**
* 逛首页列表相关的数据模型
*
* @name ListData
* @package LibModels/Wap/Guang
* @copyright yoho.inc
* @version 1.0 (2015-10-10 9:54:07)
* @author fei.hong <fei.hong@yoho.cn>
*/
class ListData
{
/**
* 逛分类
*
* 备注: id (0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士)
*
* @return array
*/
public static function category()
{
return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v1/category/get');
}
/**
* 根据分类进行分组的逛内容列表
*
* @param array $category 分类
* @param string $gender "1,3"表示男, "2,3"表示女
* @param int $page 分页第几页, 默认第1页
* @param int $channel 1表示男, 2表示女
* @param int $uid 用户ID
* @param string $udid 客户端cookie唯一标识
* @return array
*/
public static function articleGroup($category, $gender, $channel, $uid = 0, $udid, $page = 1)
{
$urlList = array();
$param = array();
foreach ($category as $value) {
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['page'] = $page;
$param['yh_channel'] = $channel;
$param['sort_id'] = $value['id'];
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['client_secret'] = Sign::getSign($param);
$urlList[ $value['id'] ] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . 'guang/api/v2/article/getList', $param);
}
return Yohobuy::getMulti($urlList);
}
}