TmallTemaiItemsSearchRequest.php
1.57 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* TOP API: tmall.temai.items.search request
*
* @author auto create
* @since 1.0, 2012-12-13 16:33:03
*/
class TmallTemaiItemsSearchRequest
{
/**
* 特卖前台类目id,传入的必须是特卖类目50100982或其下的二级类目。
**/
private $cat;
/**
* 排序类型。类型包括: s: 人气排序 p: 价格从低到高; pd: 价格从高到低; d: 月销量从高到低; pt: 按发布时间排序.
**/
private $sort;
/**
* 表示查询起始位置:
start=0:返回第1条记录到第48条记录(即第一页);
start=48:返回第48条记录到第96条记录(即第二页);
start=96,start=144,start=192......
依此类推,每次加start值加48(每页返回记录数固定为48条)
**/
private $start;
private $apiParas = array();
public function setCat($cat)
{
$this->cat = $cat;
$this->apiParas["cat"] = $cat;
}
public function getCat()
{
return $this->cat;
}
public function setSort($sort)
{
$this->sort = $sort;
$this->apiParas["sort"] = $sort;
}
public function getSort()
{
return $this->sort;
}
public function setStart($start)
{
$this->start = $start;
$this->apiParas["start"] = $start;
}
public function getStart()
{
return $this->start;
}
public function getApiMethodName()
{
return "tmall.temai.items.search";
}
public function getApiParas()
{
return $this->apiParas;
}
public function check()
{
RequestCheckUtil::checkNotNull($this->cat,"cat");
}
public function putOtherTextParam($key, $value) {
$this->apiParas[$key] = $value;
$this->$key = $value;
}
}