WlbItemQueryRequest.php
3.34 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
/**
* TOP API: taobao.wlb.item.query request
*
* @author auto create
* @since 1.0, 2012-12-13 16:33:03
*/
class WlbItemQueryRequest
{
/**
* 是否是最小库存单元,只有最小库存单元的商品才可以有库存,值只能给"true","false"来表示;
若值不在范围内,则按true处理
**/
private $isSku;
/**
* 商家编码
**/
private $itemCode;
/**
* ITEM类型(只允许输入以下英文或空)
NORMAL 0:普通商品;
COMBINE 1:是否是组合商品
DISTRIBUTION 2:是否是分销商品(货主是别人)
若值不在范围内,则按NORMAL处理
**/
private $itemType;
/**
* 商品名称
**/
private $name;
/**
* 当前页
**/
private $pageNo;
/**
* 分页记录个数,如果用户输入的记录数大于50,则一页显示50条记录
**/
private $pageSize;
/**
* 父ID,只有is_sku=1时才能有父ID,商品也可以没有付商品
**/
private $parentId;
/**
* 只能输入以下值或空:
ITEM_STATUS_VALID -- 1 表示 有效;
ITEM_STATUS_LOCK -- 2 表示锁住。
若值不在范围内,按ITEM_STATUS_VALID处理
**/
private $status;
/**
* 商品前台销售名字
**/
private $title;
private $apiParas = array();
public function setIsSku($isSku)
{
$this->isSku = $isSku;
$this->apiParas["is_sku"] = $isSku;
}
public function getIsSku()
{
return $this->isSku;
}
public function setItemCode($itemCode)
{
$this->itemCode = $itemCode;
$this->apiParas["item_code"] = $itemCode;
}
public function getItemCode()
{
return $this->itemCode;
}
public function setItemType($itemType)
{
$this->itemType = $itemType;
$this->apiParas["item_type"] = $itemType;
}
public function getItemType()
{
return $this->itemType;
}
public function setName($name)
{
$this->name = $name;
$this->apiParas["name"] = $name;
}
public function getName()
{
return $this->name;
}
public function setPageNo($pageNo)
{
$this->pageNo = $pageNo;
$this->apiParas["page_no"] = $pageNo;
}
public function getPageNo()
{
return $this->pageNo;
}
public function setPageSize($pageSize)
{
$this->pageSize = $pageSize;
$this->apiParas["page_size"] = $pageSize;
}
public function getPageSize()
{
return $this->pageSize;
}
public function setParentId($parentId)
{
$this->parentId = $parentId;
$this->apiParas["parent_id"] = $parentId;
}
public function getParentId()
{
return $this->parentId;
}
public function setStatus($status)
{
$this->status = $status;
$this->apiParas["status"] = $status;
}
public function getStatus()
{
return $this->status;
}
public function setTitle($title)
{
$this->title = $title;
$this->apiParas["title"] = $title;
}
public function getTitle()
{
return $this->title;
}
public function getApiMethodName()
{
return "taobao.wlb.item.query";
}
public function getApiParas()
{
return $this->apiParas;
}
public function check()
{
RequestCheckUtil::checkMaxLength($this->itemCode,64,"itemCode");
RequestCheckUtil::checkMinValue($this->pageNo,1,"pageNo");
RequestCheckUtil::checkMaxValue($this->pageSize,50,"pageSize");
RequestCheckUtil::checkMinValue($this->pageSize,1,"pageSize");
RequestCheckUtil::checkMaxLength($this->title,255,"title");
}
public function putOtherTextParam($key, $value) {
$this->apiParas[$key] = $value;
$this->$key = $value;
}
}